dom/tests/mochitest/chrome/window_activation.xul

Tue, 06 Jan 2015 21:39:09 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 06 Jan 2015 21:39:09 +0100
branch
TOR_BUG_9701
changeset 8
97036ab72558
permissions
-rw-r--r--

Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

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

mercurial