tor-browser

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

073.html (1361B)


      1 <!DOCTYPE html>
      2 <html><head>
      3  <title> scheduler: document.write into IFRAME a script that creates new external script in parent </title>
      4  <script src="/resources/testharness.js"></script>
      5  <script src="/resources/testharnessreport.js"></script>
      6  <script src="testlib/testlib.js"></script>
      7 
      8 </head>
      9 <body>
     10 
     11  <div id="log">FAILED (This TC requires JavaScript enabled)</div>
     12 
     13  <iframe style="width:1px;height:1px"></iframe>
     14 
     15  <script type="text/javascript">
     16    var doc = document.getElementsByTagName('iframe')[0].contentDocument;
     17    doc.open();
     18 
     19    var html = '<html><head><title>test</title></head>'+
     20              '<script>top.log("inline script #1");'+
     21              '<\/script>'+
     22              '</head>'+
     23              '<body>'+
     24              '<div id="foo"></div>'+
     25              '</body></html>'+
     26              '<script>top.testlib.addScript( \'\', { src:\'scripts/include-1.js\' }, top.document.body, true )<\/script>';
     27    log("calling document.write");
     28    doc.write(html);
     29 
     30    log("calling document.close");
     31    doc.close();
     32 
     33    var t = async_test()
     34 
     35 
     36    function test() {
     37 
     38      assert_array_equals(eventOrder, ['calling document.write',
     39          'inline script #1',
     40          'calling document.close',
     41          'external script #1'
     42        ]);
     43 
     44      t.done();
     45    }
     46 
     47    onload = t.step_func(test)
     48  </script>
     49 </head>
     50 
     51 </body>
     52 </html>