|
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"> |
|
6 |
|
7 <script type="application/javascript" |
|
8 src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js" /> |
|
9 |
|
10 <body xmlns="http://www.w3.org/1999/xhtml" id="body"> |
|
11 </body> |
|
12 |
|
13 <script class="testbody" type="application/javascript"> |
|
14 <![CDATA[ |
|
15 |
|
16 function ok(aCondition, aMessage) |
|
17 { |
|
18 window.opener.wrappedJSObject.SimpleTest.ok(aCondition, aMessage); |
|
19 } |
|
20 |
|
21 function is(aLeft, aRight, aMessage) |
|
22 { |
|
23 window.opener.wrappedJSObject.SimpleTest.is(aLeft, aRight, aMessage); |
|
24 } |
|
25 |
|
26 function isnot(aLeft, aRight, aMessage) |
|
27 { |
|
28 window.opener.wrappedJSObject.SimpleTest.isnot(aLeft, aRight, aMessage); |
|
29 } |
|
30 |
|
31 function executeSoon(aFct) |
|
32 { |
|
33 window.opener.wrappedJSObject.SimpleTest.executeSoon(aFct); |
|
34 } |
|
35 |
|
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"); |
|
42 |
|
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"); |
|
55 |
|
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 }); |
|
65 } |
|
66 } |
|
67 |
|
68 |
|
69 ]]> |
|
70 </script> |
|
71 |
|
72 </window> |