dom/tests/mochitest/general/test_bug628069_2.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=628069
     5 -->
     6 <head>
     7   <title>Test for Bug 628069</title>
     8   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     9   <script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
    10   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
    11 </head>
    12 <body>
    13 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=628069">Mozilla Bug 628069</a>
    14 <p id="display"></p>
    15 <div id="content">
    16   <iframe id="frame" style="height:100px; width:100px; border:0"></iframe>
    17   <div id="status" style="display: none"></div>
    18 </div>
    19 <pre id="test">
    20 <script type="application/javascript;version=1.7">
    22 /** Test for Bug 628069 **/
    24 gotHashChange = 0;
    25 document.addEventListener("hashChange", function(e) {
    26   gotHashChange = 1;
    27   is(e.oldURL, "oldURL");
    28   is(e.newURL, "newURL");
    29   is(e.isTrusted, false, "Hashchange event shouldn't be trusted.");
    30 }, true);
    32 let hc = document.createEvent("HashChangeEvent");
    33 hc.initHashChangeEvent("hashChange", true, false, "oldURL", "newURL");
    34 document.documentElement.dispatchEvent(hc);
    35 is(gotHashChange, 1, 'Document received hashchange event.');
    37 </script>
    38 </body>
    39 </html>

mercurial