dom/tests/mochitest/bugs/test_bug38959.html

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 <!DOCTYPE HTML>
     2 <html>
     3 <!--
     4 https://bugzilla.mozilla.org/show_bug.cgi?id=38959
     5 -->
     6 <head>
     7   <title>Test for Bug 38959</title>
     8   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     9   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
    10 </head>
    11 <body>
    12 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=38959">Mozilla Bug 38959</a>
    13 <p id="display"></p>
    14 <div id="content" style="display: none">
    15   <iframe id="frame"></iframe>
    16 </div>
    17 <pre id="test">
    18 <script type="application/javascript">
    20 /** Test for Bug 38959 **/
    22 var newValue;
    24 function watcher(id, ol, ne)
    25 {
    26   newValue = ne;
    27   return ne;
    28 }
    30 function openWindow(url, crossOrigin)
    31 {
    32   newValue = true;
    33   var w = window.open(url);
    34   w.watch("x", watcher);
    35 }
    37 function receiveMessage(evt)
    38 {
    39   ok(newValue, "Watchpoints only allowed same-origin.");
    40   if (evt.data == 1) {
    41     openWindow("/tests/dom/tests/mochitest/bugs/iframe_bug38959-2.html");
    42   }
    43   else {
    44     SimpleTest.finish();
    45   }
    46 }
    48 SimpleTest.waitForExplicitFinish();
    50 window.addEventListener("message", receiveMessage, false);
    52 openWindow("http://example.org/tests/dom/tests/mochitest/bugs/iframe_bug38959-1.html");
    54 </script>
    55 </pre>
    56 </body>
    57 </html>

mercurial