dom/tests/mochitest/chrome/DOMWindowCreated_chrome.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="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
     4 <!--
     5   Test for Persistent Storage in chrome
     6   -->
     7 <window id="sample-window" width="400" height="400"
     8         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
     9   <script type="application/javascript" 
    10           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
    11   <script type="application/javascript" 
    12           src="chrome://mochikit/content/chrome-harness.js"></script>
    14 <script type="application/javascript">
    15 var SimpleTest = window.opener.wrappedJSObject.SimpleTest;
    17 document.addEventListener("DOMWindowCreated", function(e) {
    18   var otherWindow = e.target.defaultView.wrappedJSObject;
    19   SimpleTest.is(e.type, "DOMWindowCreated", "DOMWindowCreated: " + otherWindow);
    20   otherWindow.doneFunction = function() {
    21     SimpleTest.ok(true, "doneFunction was called");
    22     SimpleTest.finish();
    23     window.close();
    24   };
    25 }, false);
    27 var root = getRootDirectory(window.location.href);
    28 var el = document.createElement("iframe");
    29 el.setAttribute('type', 'content');
    30 el.setAttribute('src', root + 'DOMWindowCreated_content.html');
    31 document.documentElement.appendChild(el);
    32 </script>
    33 </window>

mercurial