tor-browser

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

130.html (1107B)


      1 <!DOCTYPE html>
      2 <html><head>
      3  <title>scheduler: appending external script element to script </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 <div id="log"></div>
      9 <script>
     10  var t = async_test();
     11 </script>
     12 <script id="test"></script>
     13 <script>
     14 t.step(function() {
     15  log("inline script #1");
     16  var script = document.getElementById("test");
     17 
     18  var frag = document.createDocumentFragment();
     19  var inner_script = document.createElement("script");
     20 
     21  inner_script.src = "scripts/include-1.js?pipe=trickle(d1)";
     22  frag.appendChild(document.createTextNode("t.step(function() {log('inline script #2');\n"));
     23  frag.appendChild(inner_script);
     24  frag.appendChild(document.createTextNode("log('end inline script #2');})"));
     25 
     26  script.appendChild(frag);
     27  log("end inline script #1");
     28 });
     29 
     30 onload = t.step_func(function() {
     31  assert_array_equals(eventOrder, ["inline script #1", "inline script #2", "end inline script #2", "end inline script #1", "external script #1"]);
     32  t.done();
     33 });
     34 </script>