tor-browser

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

module-tla-promise.html (825B)


      1 <!doctype html>
      2 <title>document.write in an imported module</title>
      3 <script src="/resources/testharness.js"></script>
      4 <script src="/resources/testharnessreport.js"></script>
      5 <div id="log"></div>
      6 <script>
      7 async_test(t => {
      8  // Expose {test} in the iframe for using the step_timeout helper.
      9  document.test = t;
     10 
     11  const iframe = document.createElement("iframe");
     12  iframe.onerror = t.unreached_func("Error loading iframe");
     13 
     14  document.addEventListener("documentWriteDone", t.step_func(() => {
     15    assert_equals(iframe.contentDocument.body.textContent, "Initial body contents\n");
     16  }));
     17  iframe.onload = t.step_func_done(() => {
     18    assert_equals(iframe.contentDocument.body.textContent, "Initial body contents\n");
     19  });
     20 
     21  iframe.src = "module-tla-promise-iframe.html";
     22  document.body.appendChild(iframe);
     23 });
     24 </script>