dom/tests/mochitest/chrome/window_activation.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

michael@0 1 <?xml version="1.0"?>
michael@0 2 <?xml-stylesheet href="chrome://global/skin" type="text/css"?>
michael@0 3 <?xml-stylesheet href="data:text/css,
michael@0 4
michael@0 5 %23box {
michael@0 6 background: blue;
michael@0 7 }
michael@0 8
michael@0 9 %23box:-moz-window-inactive {
michael@0 10 background: cyan;
michael@0 11 }
michael@0 12
michael@0 13 " type="text/css"?>
michael@0 14
michael@0 15 <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
michael@0 16
michael@0 17 <box id="box" height="100"/>
michael@0 18
michael@0 19 <script type="application/javascript"><![CDATA[
michael@0 20
michael@0 21 var ok = window.opener.wrappedJSObject.ok;
michael@0 22 var complete = window.opener.wrappedJSObject.complete;
michael@0 23 var openerDoc = window.opener.wrappedJSObject.document;
michael@0 24 var SimpleTest = window.opener.wrappedJSObject.SimpleTest;
michael@0 25
michael@0 26 SimpleTest.waitForFocus(function () {
michael@0 27 ok(getComputedStyle(document.getElementById("box"), "").backgroundColor, "rgb(0, 0, 255)");
michael@0 28 ok(getComputedStyle(openerDoc.getElementById("box"), "").backgroundColor, "rgb(0, 255, 255)");
michael@0 29 window.opener.focus();
michael@0 30 ok(getComputedStyle(document.getElementById("box"), "").backgroundColor, "rgb(0, 255, 255)");
michael@0 31 ok(getComputedStyle(openerDoc.getElementById("box"), "").backgroundColor, "rgb(0, 0, 255)");
michael@0 32 complete();
michael@0 33 }, window);
michael@0 34
michael@0 35 ]]></script>
michael@0 36
michael@0 37 </window>

mercurial