2487
|
1 |
"{ Encoding: utf8 }"
|
|
2 |
|
2383
|
3 |
"{ Package: 'stx:goodies/regression' }"
|
|
4 |
|
|
5 |
"{ NameSpace: RegressionTests }"
|
|
6 |
|
|
7 |
TestCase subclass:#ElectronGraphicDeviceTest
|
|
8 |
instanceVariableNames:'display'
|
|
9 |
classVariableNames:''
|
|
10 |
poolDictionaries:''
|
|
11 |
category:'tests-Regression-Graphics-Basic'
|
|
12 |
!
|
|
13 |
|
|
14 |
!ElectronGraphicDeviceTest class methodsFor:'documentation'!
|
|
15 |
|
|
16 |
documentation
|
|
17 |
"
|
|
18 |
documentation to be added.
|
|
19 |
|
|
20 |
class:
|
|
21 |
<a short class summary here, describing what instances represent>
|
|
22 |
|
|
23 |
responsibilities:
|
|
24 |
<describing what my main role is>
|
|
25 |
|
|
26 |
collaborators:
|
|
27 |
<describing with whom and how I talk to>
|
|
28 |
|
|
29 |
API:
|
|
30 |
<public api and main messages>
|
|
31 |
|
|
32 |
example:
|
|
33 |
<a one-line examples on how to use - can also be in a separate example method>
|
|
34 |
|
|
35 |
implementation:
|
|
36 |
<implementation points>
|
|
37 |
|
|
38 |
[author:]
|
|
39 |
exept MBP
|
|
40 |
|
|
41 |
[instance variables:]
|
|
42 |
|
|
43 |
[class variables:]
|
|
44 |
|
|
45 |
[see also:]
|
|
46 |
|
|
47 |
"
|
|
48 |
! !
|
|
49 |
|
|
50 |
!ElectronGraphicDeviceTest methodsFor:'tests'!
|
|
51 |
|
|
52 |
setUp
|
|
53 |
display := ElectronWorkstation newFor:'localhost:8588'.
|
|
54 |
!
|
|
55 |
|
|
56 |
tearDown
|
|
57 |
display notNil ifTrue:[
|
|
58 |
display close
|
|
59 |
].
|
|
60 |
|
|
61 |
!
|
|
62 |
|
|
63 |
test_01_ConnectDisconnect
|
|
64 |
self assert:(display notNil).
|
|
65 |
self assert:(display isOpen).
|
|
66 |
display close.
|
|
67 |
self assert:(display isOpen not).
|
|
68 |
|
|
69 |
"
|
|
70 |
self new test_01_ConnectDisconnect
|
|
71 |
"
|
|
72 |
!
|
|
73 |
|
|
74 |
test_02_Properties
|
|
75 |
self assert:(display visualType notNil).
|
|
76 |
display visualType == #TrueColor ifTrue:[
|
|
77 |
self assert:(display hasColors).
|
|
78 |
self assert:(display hasGreyscales).
|
|
79 |
].
|
|
80 |
|
|
81 |
self assert:(display depth notNil).
|
|
82 |
self assert:(display shiftRed notNil).
|
|
83 |
self assert:(display shiftGreen notNil).
|
|
84 |
self assert:(display shiftBlue notNil).
|
|
85 |
|
|
86 |
self assert:(display blackpixel == 0).
|
|
87 |
self assert:(display whitepixel == 16rFFFFFF).
|
|
88 |
|
|
89 |
"
|
|
90 |
self new test_02_Properties
|
|
91 |
"
|
|
92 |
!
|
|
93 |
|
|
94 |
test_03_WindowCreation
|
|
95 |
|v|
|
|
96 |
|
2487
|
97 |
v := StandardSystemView onDevice:display.
|
2505
|
98 |
Delay waitForSeconds:3.
|
|
99 |
v destroy.
|
|
100 |
|
2383
|
101 |
"
|
|
102 |
self new test_03_WindowCreation
|
|
103 |
"
|
|
104 |
!
|
|
105 |
|
|
106 |
test_04_WindowCreateAndMap
|
|
107 |
|v|
|
|
108 |
|
2487
|
109 |
v := StandardSystemView onDevice:display.
|
2383
|
110 |
v realize.
|
2487
|
111 |
Delay waitForSeconds:1.
|
2383
|
112 |
v destroy.
|
|
113 |
|
|
114 |
"
|
|
115 |
self new test_04_WindowCreateAndMap
|
|
116 |
"
|
2487
|
117 |
!
|
|
118 |
|
|
119 |
test_05_WindowResize
|
|
120 |
|v|
|
|
121 |
|
|
122 |
v := StandardSystemView onDevice:display.
|
|
123 |
v extent:300@300.
|
|
124 |
v origin:100@100.
|
|
125 |
v realize.
|
|
126 |
Delay waitForSeconds:1.
|
|
127 |
"/ display bridge callFunction:'test1' withArguments:#().
|
|
128 |
"/ Delay waitForSeconds:1.
|
|
129 |
"/ display bridge callFunction:'test2' withArguments:#().
|
|
130 |
"/ Delay waitForSeconds:1.
|
|
131 |
"/ display bridge callFunction:'test3' withArguments:#().
|
|
132 |
|
|
133 |
v extent:600@100.
|
|
134 |
"/ display testResize:v id.
|
|
135 |
"/ v extent:(500@500).
|
|
136 |
"/ Delay waitForSeconds:1.
|
|
137 |
"/ v extent:(200@200).
|
|
138 |
Delay waitForSeconds:1.
|
|
139 |
v destroy.
|
|
140 |
|
|
141 |
"
|
|
142 |
self new
|
|
143 |
setUp;
|
|
144 |
test_05_WindowResize;
|
|
145 |
tearDown
|
|
146 |
"
|
|
147 |
!
|
|
148 |
|
|
149 |
test_06_WindowTitle
|
|
150 |
|v|
|
|
151 |
|
|
152 |
v := StandardSystemView onDevice:display.
|
|
153 |
v extent:300@300.
|
|
154 |
v realize.
|
|
155 |
Delay waitForSeconds:1.
|
|
156 |
v label:'AAAA'.
|
|
157 |
Delay waitForSeconds:1.
|
|
158 |
v label:'BBBB'.
|
|
159 |
Delay waitForSeconds:1.
|
|
160 |
v label:'CCCC'.
|
|
161 |
v destroy.
|
|
162 |
|
|
163 |
"
|
|
164 |
self new
|
|
165 |
setUp;
|
|
166 |
test_06_WindowTitle;
|
|
167 |
tearDown
|
|
168 |
"
|
|
169 |
!
|
|
170 |
|
|
171 |
test_07_WindowBackground
|
|
172 |
|v|
|
|
173 |
|
|
174 |
v := StandardSystemView onDevice:display.
|
|
175 |
v extent:300@300.
|
|
176 |
v realize.
|
|
177 |
Delay waitForSeconds:1.
|
|
178 |
v viewBackground:(Color red).
|
|
179 |
Delay waitForSeconds:1.
|
|
180 |
v viewBackground:(Color green).
|
|
181 |
Delay waitForSeconds:1.
|
|
182 |
v destroy.
|
|
183 |
|
|
184 |
"
|
|
185 |
self new
|
|
186 |
setUp;
|
|
187 |
test_07_WindowBackground;
|
|
188 |
tearDown
|
|
189 |
"
|
2488
|
190 |
!
|
|
191 |
|
|
192 |
test_08_WindowPosition
|
|
193 |
|v|
|
|
194 |
|
|
195 |
v := StandardSystemView onDevice:display.
|
|
196 |
v origin:100@100.
|
|
197 |
v extent:300@300.
|
|
198 |
v realize.
|
|
199 |
Delay waitForSeconds:1.
|
|
200 |
v origin:600@100.
|
|
201 |
Delay waitForSeconds:1.
|
|
202 |
v origin:200@300.
|
|
203 |
Delay waitForSeconds:1.
|
|
204 |
v destroy.
|
|
205 |
|
|
206 |
"
|
|
207 |
self new
|
|
208 |
setUp;
|
|
209 |
test_08_WindowPosition;
|
|
210 |
tearDown
|
|
211 |
"
|
2489
|
212 |
!
|
|
213 |
|
|
214 |
test_10_Subview
|
2503
|
215 |
"fails: subViews are NOT browserwindows,
|
|
216 |
but must be created as DIV in the renderer!!"
|
|
217 |
|
2489
|
218 |
|top v|
|
|
219 |
|
|
220 |
top := StandardSystemView onDevice:display.
|
|
221 |
top origin:100@100 extent:300@300.
|
|
222 |
top viewBackground:(Color green).
|
|
223 |
|
|
224 |
top addSubView:(v := View new).
|
|
225 |
v origin:50@50 extent:100@100.
|
|
226 |
v viewBackground:(Color red).
|
|
227 |
|
|
228 |
top realize.
|
|
229 |
Delay waitForSeconds:2.
|
|
230 |
top destroy.
|
|
231 |
|
|
232 |
"
|
|
233 |
self new
|
|
234 |
setUp;
|
|
235 |
test_10_Subview;
|
|
236 |
tearDown
|
|
237 |
"
|
2383
|
238 |
! !
|
|
239 |
|
|
240 |
!ElectronGraphicDeviceTest class methodsFor:'documentation'!
|
|
241 |
|
|
242 |
version_CVS
|
|
243 |
^ '$Header$'
|
|
244 |
! !
|
|
245 |
|