tor-browser

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

async_006.htm (1666B)


      1 <!DOCTYPE html>
      2 <html>
      3    <head>
      4        <title>A dynamically created external script executes asynchronously</title>
      5        <meta name="timeout" content="long">
      6        <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
      7        <meta description="This test ensures a dynamically created external script executes asynchronously." />
      8        <link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
      9        <link rel="help" href="https://html.spec.whatwg.org/multipage/#force-async"/>
     10        <script src="/resources/testharness.js"></script>
     11        <script src="/resources/testharnessreport.js"></script>
     12    </head>
     13    <body>
     14        <div id=log></div>
     15        <script type="text/javascript">
     16        var t = async_test("dynamically created external script executes asynchronously");
     17 
     18        function timeout()
     19        {
     20            t.step(function(){ assert_equals(document.getElementById("testresult").innerHTML, "321")});
     21            t.done();
     22        }
     23 
     24        var timer = setTimeout(timeout, 4000);
     25 
     26        function log(text)
     27        {
     28            var textNode = document.createTextNode(text);
     29            document.getElementById("testresult").appendChild(textNode);
     30        }
     31        </script>
     32 
     33        <span id="testresult"></span>
     34        <script type="text/javascript">
     35            var one = document.createElement("script");
     36            one.src="log.py?sec=3&id=1";
     37            document.head.appendChild(one);
     38 
     39            var two = document.createElement("script");
     40            two.src="log.py?sec=1&id=2";
     41            document.head.appendChild(two);
     42 
     43            log('3');
     44        </script>
     45    </body>
     46 </html>