Tue, 06 Jan 2015 21:39:09 +0100
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=459848
5 -->
6 <head>
7 <title>Test for Bug 459848</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=459848">Mozilla Bug 459848</a>
13 <p id="display"></p>
14 <div id="content" style="display: none">
16 </div>
17 <pre id="test">
18 <script type="application/javascript">
20 /** Test for Bug 459848 **/
22 var ifr1, irf2;
23 var doc1, doc2;
25 function testDocument(d) {
26 d.documentElement.setAttribute("onload", "this.setAttribute('didRun', 'true');");
27 var e = d.createEvent("Events");
28 e.initEvent("load", true, true);
29 d.documentElement.dispatchEvent(e);
30 }
32 function testDoc2() {
33 testDocument(doc2);
34 isnot(doc2.documentElement.getAttribute("didRun"), "true",
35 "Shouldn't have run an event listener");
36 SimpleTest.finish();
37 }
39 function startTest() {
40 var ifr1 = document.getElementById('iframe1');
41 var ifr2 = document.getElementById('iframe2');
42 doc1 = ifr1.contentDocument;
43 doc2 = ifr2.contentDocument;
45 testDocument(doc1);
46 is(doc1.documentElement.getAttribute("didRun"), "true",
47 "Should have run an event listener");
49 ifr2.parentNode.removeChild(ifr2);
50 setTimeout(testDoc2, 0);
51 }
52 SimpleTest.waitForExplicitFinish();
53 addLoadEvent(startTest);
55 </script>
56 </pre>
57 <iframe id="iframe1"></iframe>
58 <iframe id="iframe2"></iframe>
59 </body>
60 </html>