Fix typo in 9b54bd30006c008b4a951331b273613d5bac3abf
[pm.git] / widget / tests / window_bug522217.xul
blob8fbb21037999a16174d3dddfc2bdf67080bc160f
1 <?xml version="1.0"?>
2 <?xml-stylesheet href="chrome://global/skin" type="text/css"?>
3 <window title="Mozilla Bug 522217"
4 onload="start();"
5 xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
7 <script type="application/javascript"
8 src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js" />
10 <body xmlns="http://www.w3.org/1999/xhtml" id="body">
11 </body>
13 <script class="testbody" type="application/javascript">
14 <![CDATA[
16 function ok(aCondition, aMessage)
18 window.opener.wrappedJSObject.SimpleTest.ok(aCondition, aMessage);
21 function is(aLeft, aRight, aMessage)
23 window.opener.wrappedJSObject.SimpleTest.is(aLeft, aRight, aMessage);
26 function isnot(aLeft, aRight, aMessage)
28 window.opener.wrappedJSObject.SimpleTest.isnot(aLeft, aRight, aMessage);
31 function executeSoon(aFct)
33 window.opener.wrappedJSObject.SimpleTest.executeSoon(aFct);
36 function start() {
37 window.onfocus = function () {
38 window.onfocus = null;
39 var oldOuterWidth = window.outerWidth, oldOuterHeight = window.outerHeight;
40 var oldInnerWidth = window.innerWidth, oldInnerHeight = window.innerHeight;
41 document.documentElement.setAttribute("drawintitlebar", "true");
43 executeSoon(function() {
44 is(window.outerWidth, oldOuterWidth, "drawintitlebar shouldn't change the window's outerWidth");
45 is(window.outerHeight, oldOuterHeight, "drawintitlebar shouldn't change the window's outerHeight");
46 is(window.innerWidth, oldOuterWidth, "if drawintitlebar is set, innerWidth and outerWidth should be the same");
47 is(window.innerHeight, oldOuterHeight, "if drawintitlebar is set, innerHeight and outerHeight should be the same");
48 window.fullScreen = true;
49 window.fullScreen = false;
50 is(window.outerWidth, oldOuterWidth, "wrong outerWidth after fullscreen mode");
51 is(window.outerHeight, oldOuterHeight, "wrong outerHeight after fullscreen mode");
52 is(window.innerWidth, oldOuterWidth, "wrong innerWidth after fullscreen mode");
53 is(window.innerHeight, oldOuterHeight, "wrong innerHeight after fullscreen mode");
54 document.documentElement.removeAttribute("drawintitlebar");
56 executeSoon(function() {
57 is(window.outerWidth, oldOuterWidth, "wrong outerWidth after removing drawintitlebar");
58 is(window.outerHeight, oldOuterHeight, "wrong outerHeight after removing drawintitlebar");
59 is(window.innerWidth, oldInnerWidth, "wrong innerWidth after removing drawintitlebar");
60 is(window.innerHeight, oldInnerHeight, "wrong innerHeight after removing drawintitlebar");
61 window.opener.wrappedJSObject.SimpleTest.finish();
62 window.close();
63 });
64 });
69 ]]>
70 </script>
72 </window>