tor-browser

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

053.html (1612B)


      1 <!DOCTYPE html>
      2 <html><head>
      3        <title> scheduler: adding external script that removes itself from document when loading</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() {this.parentNode.removeChild(this);log('removed ' + this.localName);} }, document.getElementsByTagName('body')[0], true );
     14                log('end script #1');
     15        </script>
     16        <script src="scripts/include-2.js"></script>
     17        <script type="text/javascript">
     18        log( 'inline script #2' );
     19        var t = async_test()
     20 
     21        function test() {
     22                assert_any(assert_array_equals, eventOrder, [['inline script #1', 'end script #1', 'external script #1', 'removed script', 'external script #2', 'inline script #2'],
     23                                                             ['inline script #1', 'end script #1', 'external script #2', 'external script #1', 'removed script', 'inline script #2'],
     24                                                             ['inline script #1', 'end script #1', 'external script #2', 'inline script #2', 'external script #1', 'removed script']]
     25                                                            );
     26                t.done();
     27        }
     28        onload = t.step_func(test)
     29        </script>
     30 
     31 </body></html>