tizen beta release
[framework/web/webkit-efl.git] / LayoutTests / fast / dom / Window / window-resize-and-move-arguments.html
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4     <script src="../../js/resources/js-test-pre.js"></script>
5 </head>
6 <body>
7 <script language="JavaScript" type="text/javascript">
8     var resetWidth;
9     var resetHeight;
10     var resetX;
11     var resetY;
12
13     var width = 100;
14     var height = 200;
15     var x = 25;
16     var y = 50;
17
18     function reset()
19     {
20         window.moveTo(0, 0);
21         window.resizeTo(300, 200);
22         resetWidth = window.outerWidth;
23         resetHeight = window.outerHeight;
24         resetX = window.screenX;
25         resetY = window.screenY;
26     }
27
28     if (window.layoutTestController)
29         layoutTestController.dumpAsText();
30
31     reset();
32
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.");
35
36     // resizeTo /////////////////////////
37     debug('');
38     debug('window.resizeTo Tests');
39     debug('');
40
41     debug("Testing - resizeTo with 0 arguments");
42     window.resizeTo();
43     shouldBe('window.outerWidth', 'resetWidth');
44     shouldBe('window.outerHeight', 'resetHeight');
45     reset();
46
47     debug("Testing - resizeTo with 1 argument");
48     window.resizeTo(x);
49     shouldBe('window.outerWidth', 'width');
50     shouldBe('window.outerHeight', 'resetHeight');
51     reset();
52
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');
57     reset();
58
59     // resizeBy /////////////////////////
60     debug('');
61     debug('window.resizeBy Tests');
62     debug('');
63
64     debug("Testing - resizeBy with 0 arguments");
65     window.resizeBy();
66     shouldBe('window.outerWidth', 'resetWidth');
67     shouldBe('window.outerHeight', 'resetHeight');
68     reset();
69
70     debug("Testing - resizeBy with 1 argument");
71     window.resizeBy(x);
72     shouldBe('window.outerWidth', 'resetWidth + x');
73     shouldBe('window.outerHeight', 'resetHeight');
74     reset();
75
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');
80     reset();
81
82
83     // moveTo /////////////////////////
84     debug('');
85     debug('window.moveTo Tests');
86     debug('');
87
88     debug("Testing - moveTo with 0 arguments");
89     window.moveTo();
90     shouldBe('window.screenX', 'resetX');
91     shouldBe('window.screenY', 'resetY');
92     reset();
93
94     debug("Testing - moveTo with 1 argument");
95     window.moveTo(x);
96     shouldBe('window.screenX', 'resetX + x');
97     shouldBe('window.screenY', 'resetY');
98     reset();
99
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');
104     reset();
105
106
107
108     // moveBy /////////////////////////
109     debug('');
110     debug('window.moveBy Tests');
111     debug('');
112
113     debug("Testing - moveBy with 0 arguments");
114     window.moveBy();
115     shouldBe('window.screenX', 'resetX');
116     shouldBe('window.screenY', 'resetY');
117     reset();
118
119     debug("Testing - moveBy with 1 argument");
120     window.moveBy(x);
121     shouldBe('window.screenX', 'resetX + x');
122     shouldBe('window.screenY', 'resetY');
123     reset();
124
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');
129 </script>
130 <script src="../../js/resources/js-test-post.js"></script>
131 </body>
132 </html>