tor-browser

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

078.html (1476B)


      1 <!DOCTYPE html>
      2 <html>
      3 <head>
      4 <title> adding several types of scripts through the DOM and removing some of them confuses scheduler (slow-loading scripts) </title>
      5 <meta name="timeout" content="long">
      6 <script src="/resources/testharness.js"></script>
      7 <script src="/resources/testharnessreport.js"></script>
      8 <script src="testlib/testlib.js"></script>
      9 <script type="text/javascript">
     10    setup({ explicit_done: true });
     11    var head = document.getElementsByTagName('head')[0];
     12    function createScript(url, contents) {
     13        props = {};
     14        if (url) {
     15            props.src = url;
     16        }
     17        return testlib.addScript(contents, props, head, false);
     18    }
     19    var t = async_test()
     20 
     21    function test() {
     22        document.getElementById("log").textContent = "Please wait..."
     23        var url = 'scripts/include-1.js?pipe=trickle(d1)';
     24        var script = createScript(url);
     25        var script2 = createScript('', 'log("Script #2 ran")');
     26        head.removeChild(script2);
     27        var url = 'scripts/include-2.js?pipe=trickle(d2)';
     28        var script3 = createScript(url);
     29        head.removeChild(script3);
     30 
     31        setTimeout(t.step_func(function () {
     32            done();
     33            assert_array_equals(eventOrder, ['Script #2 ran', 'external script #1', 'external script #2']);
     34            t.done();
     35        }), 5500);
     36 
     37    };
     38    onload = t.step_func(test)
     39 </script>
     40 </head>
     41 <body>
     42 <div id="log">FAILED (This TC requires JavaScript enabled)</div>
     43 </body>
     44 </html>