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"
15 title=
"Window State Tests">
17 <script src=
"chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
18 <script type=
"application/javascript">
21 SimpleTest.waitForExplicitFinish();
24 var win = Services.wm.getMostRecentWindow(
"navigator:browser");
27 switch(win.windowState) {
28 case win.STATE_FULLSCREEN:
29 dump(
"STATE_FULLSCREEN \n");
31 case win.STATE_MAXIMIZED:
32 dump(
"STATE_MAXIMIZED \n");
34 case win.STATE_MINIMIZED:
35 dump(
"STATE_MINIMIZED \n");
37 case win.STATE_NORMAL:
38 dump(
"STATE_NORMAL \n");
43 // Make sure size mode changes are reflected in the widget.
45 ok(win.windowState == win.STATE_NORMAL,
"window state is restored.");
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.
56 ok(win.windowState == win.STATE_NORMAL,
"window state is restored.");
58 ok(win.windowState == win.STATE_MAXIMIZED,
"window state is maximized.");
60 ok(win.windowState == win.STATE_NORMAL,
"window state is restored.");
63 dump(win.screenX +
"\n");
65 dump(win.screenX +
"\n");
67 dump(win.screenX +
"\n");
75 <body xmlns=
"http://www.w3.org/1999/xhtml">
77 <div id=
"content" style=
"display: none"></div>