dom/tests/mochitest/chrome/window_activation.xul

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/tests/mochitest/chrome/window_activation.xul	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,37 @@
     1.4 +<?xml version="1.0"?>
     1.5 +<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
     1.6 +<?xml-stylesheet href="data:text/css,
     1.7 +
     1.8 +%23box {
     1.9 +  background: blue;
    1.10 +}
    1.11 +
    1.12 +%23box:-moz-window-inactive {
    1.13 +  background: cyan;
    1.14 +}
    1.15 +
    1.16 +" type="text/css"?>
    1.17 +
    1.18 +<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
    1.19 +
    1.20 +<box id="box" height="100"/>
    1.21 +
    1.22 +<script type="application/javascript"><![CDATA[
    1.23 +
    1.24 +var ok = window.opener.wrappedJSObject.ok;
    1.25 +var complete = window.opener.wrappedJSObject.complete;
    1.26 +var openerDoc = window.opener.wrappedJSObject.document;
    1.27 +var SimpleTest = window.opener.wrappedJSObject.SimpleTest;
    1.28 +
    1.29 +SimpleTest.waitForFocus(function () {
    1.30 +  ok(getComputedStyle(document.getElementById("box"), "").backgroundColor, "rgb(0, 0, 255)");
    1.31 +  ok(getComputedStyle(openerDoc.getElementById("box"), "").backgroundColor, "rgb(0, 255, 255)");
    1.32 +  window.opener.focus();
    1.33 +  ok(getComputedStyle(document.getElementById("box"), "").backgroundColor, "rgb(0, 255, 255)");
    1.34 +  ok(getComputedStyle(openerDoc.getElementById("box"), "").backgroundColor, "rgb(0, 0, 255)");
    1.35 +  complete();
    1.36 +}, window);
    1.37 +
    1.38 +]]></script>
    1.39 +
    1.40 +</window>

mercurial