OLD | NEW |
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script src="../../../resources/js-test.js"></script> | 4 <script src="../../../resources/js-test.js"></script> |
5 </head> | 5 </head> |
6 <body> | 6 <body> |
7 <script language="JavaScript" type="text/javascript"> | 7 <script language="JavaScript" type="text/javascript"> |
8 var resetWidth; | 8 var resetWidth; |
9 var resetHeight; | 9 var resetHeight; |
10 var resetX; | 10 var resetX; |
(...skipping 21 matching lines...) Expand all Loading... |
32 | 32 |
33 description("This test makes sure that calling the window moving and resizin
g\ | 33 description("This test makes sure that calling the window moving and resizin
g\ |
34 methods with less than 2 arguments treats the missing arguments as 0."); | 34 methods with less than 2 arguments treats the missing arguments as 0."); |
35 | 35 |
36 // resizeTo ///////////////////////// | 36 // resizeTo ///////////////////////// |
37 debug(''); | 37 debug(''); |
38 debug('window.resizeTo Tests'); | 38 debug('window.resizeTo Tests'); |
39 debug(''); | 39 debug(''); |
40 | 40 |
41 debug("Testing - resizeTo with 0 arguments"); | 41 debug("Testing - resizeTo with 0 arguments"); |
42 window.resizeTo(); | 42 shouldThrow('window.resizeTo()'); |
43 shouldBe('window.outerWidth', 'resetWidth'); | 43 shouldBe('window.outerWidth', 'resetWidth'); |
44 shouldBe('window.outerHeight', 'resetHeight'); | 44 shouldBe('window.outerHeight', 'resetHeight'); |
45 reset(); | 45 reset(); |
46 | 46 |
47 debug("Testing - resizeTo with 1 argument"); | 47 debug("Testing - resizeTo with 1 argument"); |
48 window.resizeTo(x); | 48 shouldThrow('window.resizeTo(width)'); |
49 shouldBe('window.outerWidth', 'width'); | 49 shouldBe('window.outerWidth', 'resetWidth'); |
50 shouldBe('window.outerHeight', 'resetHeight'); | 50 shouldBe('window.outerHeight', 'resetHeight'); |
51 reset(); | 51 reset(); |
52 | 52 |
53 debug("Testing - resizeTo with more than 2 arguments"); | 53 debug("Testing - resizeTo with more than 2 arguments"); |
54 window.resizeTo(width, height, 200, "text"); | 54 window.resizeTo(width, height, 200, "text"); |
55 shouldBe('window.outerWidth', 'width'); | 55 shouldBe('window.outerWidth', 'width'); |
56 shouldBe('window.outerHeight', 'height'); | 56 shouldBe('window.outerHeight', 'height'); |
57 reset(); | 57 reset(); |
58 | 58 |
59 // resizeBy ///////////////////////// | 59 // resizeBy ///////////////////////// |
60 debug(''); | 60 debug(''); |
61 debug('window.resizeBy Tests'); | 61 debug('window.resizeBy Tests'); |
62 debug(''); | 62 debug(''); |
63 | 63 |
64 debug("Testing - resizeBy with 0 arguments"); | 64 debug("Testing - resizeBy with 0 arguments"); |
65 window.resizeBy(); | 65 shouldThrow('window.resizeBy()'); |
66 shouldBe('window.outerWidth', 'resetWidth'); | 66 shouldBe('window.outerWidth', 'resetWidth'); |
67 shouldBe('window.outerHeight', 'resetHeight'); | 67 shouldBe('window.outerHeight', 'resetHeight'); |
68 reset(); | 68 reset(); |
69 | 69 |
70 debug("Testing - resizeBy with 1 argument"); | 70 debug("Testing - resizeBy with 1 argument"); |
71 window.resizeBy(x); | 71 shouldThrow('window.resizeBy(x)'); |
72 shouldBe('window.outerWidth', 'resetWidth + x'); | 72 shouldBe('window.outerWidth', 'resetWidth'); |
73 shouldBe('window.outerHeight', 'resetHeight'); | 73 shouldBe('window.outerHeight', 'resetHeight'); |
74 reset(); | 74 reset(); |
75 | 75 |
76 debug("Testing - resizeBy with more than 2 arguments"); | 76 debug("Testing - resizeBy with more than 2 arguments"); |
77 window.resizeBy(x, y, 200, "text"); | 77 window.resizeBy(x, y, 200, "text"); |
78 shouldBe('window.outerWidth', 'resetWidth + x'); | 78 shouldBe('window.outerWidth', 'resetWidth + x'); |
79 shouldBe('window.outerHeight', 'resetHeight + y'); | 79 shouldBe('window.outerHeight', 'resetHeight + y'); |
80 reset(); | 80 reset(); |
81 | 81 |
82 | 82 |
83 // moveTo ///////////////////////// | 83 // moveTo ///////////////////////// |
84 debug(''); | 84 debug(''); |
85 debug('window.moveTo Tests'); | 85 debug('window.moveTo Tests'); |
86 debug(''); | 86 debug(''); |
87 | 87 |
88 debug("Testing - moveTo with 0 arguments"); | 88 debug("Testing - moveTo with 0 arguments"); |
89 window.moveTo(); | 89 shouldThrow('window.moveTo()'); |
90 shouldBe('window.screenX', 'resetX'); | 90 shouldBe('window.screenX', 'resetX'); |
91 shouldBe('window.screenY', 'resetY'); | 91 shouldBe('window.screenY', 'resetY'); |
92 reset(); | 92 reset(); |
93 | 93 |
94 debug("Testing - moveTo with 1 argument"); | 94 debug("Testing - moveTo with 1 argument"); |
95 window.moveTo(x); | 95 shouldThrow('window.moveTo(x)'); |
96 shouldBe('window.screenX', 'Math.max(x, screen.availLeft)'); | 96 shouldBe('window.screenX', 'resetX'); |
97 shouldBe('window.screenY', 'resetY'); | 97 shouldBe('window.screenY', 'resetY'); |
98 reset(); | 98 reset(); |
99 | 99 |
100 debug("Testing - moveTo with more than 2 arguments"); | 100 debug("Testing - moveTo with more than 2 arguments"); |
101 window.moveTo(x, y, 200, "text"); | 101 window.moveTo(x, y, 200, "text"); |
102 shouldBe('window.screenX', 'Math.max(x, screen.availLeft)'); | 102 shouldBe('window.screenX', 'Math.max(x, screen.availLeft)'); |
103 shouldBe('window.screenY', 'Math.max(y, screen.availTop)'); | 103 shouldBe('window.screenY', 'Math.max(y, screen.availTop)'); |
104 reset(); | 104 reset(); |
105 | 105 |
106 | 106 |
107 | 107 |
108 // moveBy ///////////////////////// | 108 // moveBy ///////////////////////// |
109 debug(''); | 109 debug(''); |
110 debug('window.moveBy Tests'); | 110 debug('window.moveBy Tests'); |
111 debug(''); | 111 debug(''); |
112 | 112 |
113 debug("Testing - moveBy with 0 arguments"); | 113 debug("Testing - moveBy with 0 arguments"); |
114 window.moveBy(); | 114 shouldThrow('window.moveBy()'); |
115 shouldBe('window.screenX', 'resetX'); | 115 shouldBe('window.screenX', 'resetX'); |
116 shouldBe('window.screenY', 'resetY'); | 116 shouldBe('window.screenY', 'resetY'); |
117 reset(); | 117 reset(); |
118 | 118 |
119 debug("Testing - moveBy with 1 argument"); | 119 debug("Testing - moveBy with 1 argument"); |
120 window.moveBy(x); | 120 shouldThrow('window.moveBy(x)'); |
121 shouldBe('window.screenX', 'resetX + x'); | 121 shouldBe('window.screenX', 'resetX'); |
122 shouldBe('window.screenY', 'resetY'); | 122 shouldBe('window.screenY', 'resetY'); |
123 reset(); | 123 reset(); |
124 | 124 |
125 debug("Testing - moveBy with more than 2 arguments"); | 125 debug("Testing - moveBy with more than 2 arguments"); |
126 window.moveBy(x, y, 200, "text"); | 126 window.moveBy(x, y, 200, "text"); |
127 shouldBe('window.screenX', 'resetX + x'); | 127 shouldBe('window.screenX', 'resetX + x'); |
128 shouldBe('window.screenY', 'resetY + y'); | 128 shouldBe('window.screenY', 'resetY + y'); |
129 </script> | 129 </script> |
130 </body> | 130 </body> |
131 </html> | 131 </html> |
OLD | NEW |