2 <?xml-stylesheet href=
"chrome://global/skin" type=
"text/css"?>
3 <?xml-stylesheet href=
"chrome://mochikit/content/tests/SimpleTest/test.css" type=
"text/css"?>
5 Test for fullscreen sizemode in chrome
7 <window xmlns=
"http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
12 <script type=
"text/javascript">
15 checkAndContinue(
"normal");
19 listen(
"fullscreen", () =
> checkAndContinue(
"fullscreen"));
20 window.fullScreen = true;
24 listen(
"fullscreen", () =
> checkAndContinue(
"normal"));
25 window.fullScreen = false;
29 listen(
"resize", () =
> checkAndContinue(
"maximized"));
34 listen(
"fullscreen", () =
> checkAndContinue(
"fullscreen"));
35 window.fullScreen = true;
39 listen(
"fullscreen", () =
> checkAndContinue(
"maximized"));
40 window.fullScreen = false;
44 listen(
"resize", () =
> checkAndContinue(
"normal"));
49 window.arguments[
0].done();
57 function listen(event, fn) {
58 window.addEventListener(event, function listener() {
63 function checkAndContinue(sizemode) {
66 "fullscreen": window.STATE_FULLSCREEN,
67 "normal": window.STATE_NORMAL,
68 "maximized": window.STATE_MAXIMIZED
71 setTimeout(function() {
72 is(window.document.documentElement.getAttribute(
"sizemode"), sizemode,
"sizemode attribute should match actual window state");
73 is(window.fullScreen, sizemode ==
"fullscreen",
"window.fullScreen should match actual window state");
74 is(window.windowState, windowStates[sizemode],
"window.sizeMode should match actual window state");
79 let is = window.arguments[
0].is;
83 <body xmlns=
"http://www.w3.org/1999/xhtml">