tor-browser

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

129.html (1099B)


      1 <!DOCTYPE html>
      2 <html><head>
      3  <title>scheduler: appending multiple script elements</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 <div id="container"></div>
     13 <script>
     14 t.step(function() {
     15  log("inline script #1");
     16 
     17  var frag = document.createDocumentFragment();
     18 
     19  scripts = ["2", "3", "4"].map(function(x) {
     20    var s = document.createElement("script");
     21    s.textContent = "t.step(function() {log('inline script #" + x + "')});";
     22    return s
     23  });
     24 
     25 
     26  frag.appendChild(scripts[0]);
     27  var div = document.createElement(div);
     28  div.appendChild(scripts[1]);
     29  frag.appendChild(div);
     30  frag.appendChild(scripts[2]);
     31 
     32  document.getElementById("container").appendChild(frag);
     33  log("end inline script #1");
     34 });
     35 
     36 onload = t.step_func(function() {
     37  assert_array_equals(eventOrder, ["inline script #1", "inline script #2", "inline script #3", "inline script #4", "end inline script #1"]);
     38  t.done();
     39 });
     40 </script>