dom/tests/mochitest/dom-level0/test_crossdomainprops.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 <head>
     4   <title>Test for Cross domain access to properties</title>
     5   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>        
     6   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
     7 </head>
     8 <body onload="runTest()">
     9 <p id="display"></p>
    10 <div id="content" style="display: none">
    12 </div>
    13 <iframe name="frame1" src="file_crossdomainprops_inner.html"></iframe>
    14 <iframe name="frame2" src="http://example.com/tests/dom/tests/mochitest/dom-level0/file_crossdomainprops_inner.html"></iframe>
    15 <pre id="test">
    16 <script class="testbody" type="text/javascript">
    18 SimpleTest.waitForExplicitFinish();
    20 function runTest() {
    21   ok(frames.frame1.myVar == 10, "access same domain inner window variable");
    22   var otherDomainVar = null;
    23   try {
    24     otherDomainVar = frames.frame2.myVar;
    25   }
    26   catch (e) {
    27     otherDomainVar = -1;
    28   }
    29   is(otherDomainVar, -1, "access other domain inner window variable");
    30   SimpleTest.finish();
    31 }
    33 </script>
    34 </pre>
    35 </body>
    36 </html>

mercurial