Bug 1843499 - Part 5: Remove AsyncFunctionResolveKind. r=iain
[gecko.git] / widget / tests / window_state_windows.xhtml
blob60989db144574ffb2b254cb3fce08850025803d8
1 <?xml version="1.0"?>
3 <!-- This Source Code Form is subject to the terms of the Mozilla Public
4 - License, v. 2.0. If a copy of the MPL was not distributed with this
5 - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
7 <?xml-stylesheet href="chrome://global/skin" type="text/css"?>
8 <?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
10 <window id="NativeWindow"
11 xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
12 width="300"
13 height="300"
14 onload="onLoad();"
15 title="Window State Tests">
17 <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
18 <script type="application/javascript">
19 <![CDATA[
21 SimpleTest.waitForExplicitFinish();
23 function onLoad() {
24 var win = Services.wm.getMostRecentWindow("navigator:browser");
27 switch(win.windowState) {
28 case win.STATE_FULLSCREEN:
29 dump("STATE_FULLSCREEN \n");
30 break;
31 case win.STATE_MAXIMIZED:
32 dump("STATE_MAXIMIZED \n");
33 break;
34 case win.STATE_MINIMIZED:
35 dump("STATE_MINIMIZED \n");
36 break;
37 case win.STATE_NORMAL:
38 dump("STATE_NORMAL \n");
39 break;
43 // Make sure size mode changes are reflected in the widget.
44 win.restore();
45 ok(win.windowState == win.STATE_NORMAL, "window state is restored.");
46 win.minimize();
47 ok(win.windowState == win.STATE_MINIMIZED, "window state is minimized.");
49 // Windows resizes children to 0x0. Code in nsWindow filters these changes out. Without
50 // this all sorts of screwy things can happen in child widgets.
51 ok(document.documentElement.clientHeight > 0, "document height should not be zero for a minimized window!");
52 ok(document.documentElement.clientWidth > 0, "document width should not be zero for a minimized window!");
54 // Make sure size mode changes are reflected in the widget.
55 win.restore();
56 ok(win.windowState == win.STATE_NORMAL, "window state is restored.");
57 win.maximize();
58 ok(win.windowState == win.STATE_MAXIMIZED, "window state is maximized.");
59 win.restore();
60 ok(win.windowState == win.STATE_NORMAL, "window state is restored.");
63 dump(win.screenX + "\n");
64 win.minimize();
65 dump(win.screenX + "\n");
66 win.restore();
67 dump(win.screenX + "\n");
70 SimpleTest.finish();
73 ]]>
74 </script>
75 <body xmlns="http://www.w3.org/1999/xhtml">
76 <p id="display"></p>
77 <div id="content" style="display: none"></div>
78 <pre id="test"></pre>
79 </body>
80 </window>