widget/tests/window_bug522217.xul

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     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)
    17 {
    18   window.opener.wrappedJSObject.SimpleTest.ok(aCondition, aMessage);
    19 }
    21 function is(aLeft, aRight, aMessage)
    22 {
    23   window.opener.wrappedJSObject.SimpleTest.is(aLeft, aRight, aMessage);
    24 }
    26 function isnot(aLeft, aRight, aMessage)
    27 {
    28   window.opener.wrappedJSObject.SimpleTest.isnot(aLeft, aRight, aMessage);
    29 }
    31 function executeSoon(aFct)
    32 {
    33   window.opener.wrappedJSObject.SimpleTest.executeSoon(aFct);
    34 }
    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     });
    65   }
    66 }
    69 ]]>
    70 </script>
    72 </window>

mercurial