1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
4 <script src="../../js/resources/js-test-pre.js"></script>
7 <script language="JavaScript" type="text/javascript">
21 window.resizeTo(300, 200);
22 resetWidth = window.outerWidth;
23 resetHeight = window.outerHeight;
24 resetX = window.screenX;
25 resetY = window.screenY;
28 if (window.layoutTestController)
29 layoutTestController.dumpAsText();
33 description("This test makes sure that calling the window moving and resizing\
34 methods with less than 2 arguments treats the missing arguments as 0.");
36 // resizeTo /////////////////////////
38 debug('window.resizeTo Tests');
41 debug("Testing - resizeTo with 0 arguments");
43 shouldBe('window.outerWidth', 'resetWidth');
44 shouldBe('window.outerHeight', 'resetHeight');
47 debug("Testing - resizeTo with 1 argument");
49 shouldBe('window.outerWidth', 'width');
50 shouldBe('window.outerHeight', 'resetHeight');
53 debug("Testing - resizeTo with more than 2 arguments");
54 window.resizeTo(width, height, 200, "text");
55 shouldBe('window.outerWidth', 'width');
56 shouldBe('window.outerHeight', 'height');
59 // resizeBy /////////////////////////
61 debug('window.resizeBy Tests');
64 debug("Testing - resizeBy with 0 arguments");
66 shouldBe('window.outerWidth', 'resetWidth');
67 shouldBe('window.outerHeight', 'resetHeight');
70 debug("Testing - resizeBy with 1 argument");
72 shouldBe('window.outerWidth', 'resetWidth + x');
73 shouldBe('window.outerHeight', 'resetHeight');
76 debug("Testing - resizeBy with more than 2 arguments");
77 window.resizeBy(x, y, 200, "text");
78 shouldBe('window.outerWidth', 'resetWidth + x');
79 shouldBe('window.outerHeight', 'resetHeight + y');
83 // moveTo /////////////////////////
85 debug('window.moveTo Tests');
88 debug("Testing - moveTo with 0 arguments");
90 shouldBe('window.screenX', 'resetX');
91 shouldBe('window.screenY', 'resetY');
94 debug("Testing - moveTo with 1 argument");
96 shouldBe('window.screenX', 'resetX + x');
97 shouldBe('window.screenY', 'resetY');
100 debug("Testing - moveTo with more than 2 arguments");
101 window.moveTo(x, y, 200, "text");
102 shouldBe('window.screenX', 'x + screen.availLeft');
103 shouldBe('window.screenY', 'y + screen.availTop');
108 // moveBy /////////////////////////
110 debug('window.moveBy Tests');
113 debug("Testing - moveBy with 0 arguments");
115 shouldBe('window.screenX', 'resetX');
116 shouldBe('window.screenY', 'resetY');
119 debug("Testing - moveBy with 1 argument");
121 shouldBe('window.screenX', 'resetX + x');
122 shouldBe('window.screenY', 'resetY');
125 debug("Testing - moveBy with more than 2 arguments");
126 window.moveBy(x, y, 200, "text");
127 shouldBe('window.screenX', 'resetX + x');
128 shouldBe('window.screenY', 'resetY + y');
130 <script src="../../js/resources/js-test-post.js"></script>