tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

test_bug753278.html (1206B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <!--
      4 https://bugzilla.mozilla.org/show_bug.cgi?id=753278
      5 -->
      6 <head>
      7  <meta charset="utf-8">
      8  <title>Test for Bug 753278</title>
      9  <script src="/tests/SimpleTest/SimpleTest.js"></script>
     10  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     11 </head>
     12 <body onload="runTest();">
     13 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=753278">Mozilla Bug 753278</a>
     14 <p id="display"></p>
     15 <div id="content" style="display: none">
     16 <iframe></iframe>  
     17 </div>
     18 <pre id="test">
     19 <script type="application/javascript">
     20 
     21 /** Test for Bug 753278 */
     22 
     23 SimpleTest.waitForExplicitFinish();
     24 
     25 var f = document.getElementsByTagName("iframe")[0];
     26 
     27 function runTest() {
     28  f.contentDocument.open();
     29  f.contentDocument.write('<script>window.location = "file_bug753278.html"; document.close(); document.open(); document.write("\\u003Cscript>parent.fail();\\u003C/script>"); document.close();\u003c/script>');
     30  f.contentDocument.close();
     31 }
     32 
     33 function pass() {
     34  ok(true, "window.location took precedence");
     35  SimpleTest.finish();
     36 }
     37 
     38 function fail() {
     39  ok(false, "window.location should have taken precedence");
     40  SimpleTest.finish();
     41 }
     42 
     43 </script>
     44 </pre>
     45 </body>
     46 </html>