tor-browser

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

076.html (1464B)


      1 <!DOCTYPE html>
      2 <html><head>
      3        <title> scheduler: adding and removing external and inline scripts </title>
      4        <script src="/resources/testharness.js"></script>
      5        <script src="/resources/testharnessreport.js"></script>
      6        <script src="testlib/testlib.js"></script>
      7 </head>
      8 <body>
      9 
     10        <div id="log">FAILED (This TC requires JavaScript enabled)</div>
     11 
     12        <script>log('inline script #1');
     13                var script=testlib.addScript('', {src:'scripts/include-1.js', onload:function(e){ e.target.parentNode.removeChild(e.target); }}, document.getElementsByTagName('head')[0], false );
     14                var script=testlib.addScript( 'log( "dynamically added inline script" )', null, document.getElementsByTagName('head')[0], false );
     15                script.parentNode.removeChild(script);
     16                log('end script #1');
     17        </script>
     18 
     19        <script type="text/javascript">
     20        log( 'inline script #2' );
     21        var t = async_test()
     22 
     23        function test() {
     24        }
     25        onload = t.step_func(function() {
     26          assert_any(assert_array_equals, eventOrder, [['inline script #1', 'dynamically added inline script', 'end script #1', 'external script #1', 'inline script #2'],
     27                                                       ['inline script #1', 'dynamically added inline script', 'end script #1', 'inline script #2', 'external script #1']]);
     28          t.done();
     29        })
     30        </script>
     31 
     32 </body></html>