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=504862
5 -->
6 <head>
7 <title>Test for Bug 504862</title>
8 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
9 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
10 </head>
11 <body onload="runTest()">
12 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=504862">Mozilla Bug 504862</a>
13 <script class="testbody" type="text/javascript">
15 /** Test for Bug 504862 **/
16 SimpleTest.waitForExplicitFinish();
17 function onMsgRcv(event)
18 {
19 is(event.data, "args: undefined", "Unexpected cross origin dialog arguments.");
20 }
22 function runTest() {
23 window.addEventListener("message", onMsgRcv, false);
25 var result = window.showModalDialog("file_bug504862.html", "my args");
26 // NB: We used to clear returnValue on each navigation, but now we do a
27 // security check on access, so we can safely make returnValue live on
28 // the browsing context, per spec.
29 is(result, 3, "window sees previous dialog documents return value.");
31 result = window.showModalDialog("http://test1.example.com/tests/dom/tests/mochitest/bugs/file_bug504862.html", "my args");
33 is(result, null, "Able to see return value from cross origin dialog.");
35 SimpleTest.finish();
36 }
38 </script>
39 </pre>
40 </body>
41 </html>