1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
4 <script src="../../../resources/js-test.js"></script>
7 <script language="JavaScript" type="text/javascript">
8 // FIXME Disabled because of <rdar://problem/5569119>
10 if (window.testRunner)
11 testRunner.dumpAsText();
15 description("This test makes sure that we cannot set the parameter of a \
16 window to NaN, causing unpredicable results");
23 var defaultSize = 500;
24 var defaultLocation = 0;
26 // initialize window to a known size
29 window.resizeTo(x, y);
31 // resizeTo /////////////////////////
33 debug('window.resizeTo Tests');
38 window.resizeTo(x, y);
39 debug("Testing - resizeTo: Bad width input");
40 shouldBe('window.outerWidth', 'defaultSize');
41 shouldBe('window.outerHeight', 'defaultSize');
47 window.resizeTo(x, y);
48 debug("Testing - resizeTo: Bad height input");
49 shouldBe('window.outerWidth', 'defaultSize');
50 shouldBe('window.outerHeight', 'defaultSize');
56 window.resizeTo(x, y);
57 debug("Testing - resizeTo: Bad width and height input");
58 shouldBe('window.outerWidth', 'defaultSize');
59 shouldBe('window.outerHeight', 'defaultSize');
61 // resizeBy /////////////////////////
63 debug('window.resizeBy Tests');
68 window.resizeBy(x, y);
69 debug("Testing - resizeBy: Bad width input");
70 shouldBe('window.outerWidth', 'defaultSize');
71 shouldBe('window.outerHeight', 'defaultSize + y');
74 window.resizeTo(defaultSize, defaultSize);
78 window.resizeBy(x, y);
79 debug("Testing - resizeBy: Bad height input");
80 shouldBe('window.outerWidth', 'defaultSize + x');
81 shouldBe('window.outerHeight', 'defaultSize');
83 // moveTo /////////////////////////
85 debug('window.moveTo Tests');
87 window.moveTo(screen.availLeft, screen.availTop);
90 y = screen.availTop + 100;
92 debug("Testing - moveTo: Bad x input");
93 shouldBe('window.screenY', 'y + (screen.availTop * 2)'); // FIXME this should be just y
94 shouldBe('window.screenX', 'screen.availLeft');
97 window.moveTo(screen.availLeft, screen.availTop);
99 x = screen.availLeft + 100;
102 debug("Testing - moveTo: Bad y input");
103 shouldBe('window.screenY', 'screen.availTop * 2'); // FIXME this should just be screen.availTop
104 shouldBe('window.screenX', 'x');
107 window.moveTo(screen.availLeft, screen.availTop);
112 debug("Testing - moveTo: Bad x and y input");
113 shouldBe('window.screenY', 'screen.availTop * 2'); // FIXME this should just be screen.availTop
114 shouldBe('window.screenX', 'screen.availLeft');
116 // moveBy /////////////////////////
118 debug('window.moveBy Tests');
120 window.moveTo(screen.availLeft, screen.availTop);
125 debug("Testing - moveBy: Bad x input");
126 shouldBe('window.screenY', '(screen.availTop * 4) + y'); // FIXME this should just be screen.availTop + y
127 shouldBe('window.screenX', 'screen.availLeft');
130 window.moveTo(screen.availLeft, screen.availTop);
135 debug("Testing - moveBy: Bad y input");
136 shouldBe('window.screenY', 'screen.availTop * 4'); // FIXME this should just be screen.availTop
137 shouldBe('window.screenX', 'screen.availLeft + x');
140 window.moveTo(screen.availLeft, screen.availTop);
145 debug("Testing - moveBy: Bad x and y input");
146 shouldBe('window.screenY', 'screen.availTop * 4'); // FIXME this should just be screen.availTop
147 shouldBe('window.screenX', 'screen.availLeft');