tor-browser

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

Window-document.html (915B)


      1 <!doctype html>
      2 <meta charset=utf-8>
      3 <title>Window#document</title>
      4 <script src=/resources/testharness.js></script>
      5 <script src=/resources/testharnessreport.js></script>
      6 <div id=log></div>
      7 <script>
      8 async_test(function() {
      9  var URL = "/common/blank.html";
     10 
     11  var iframe = document.createElement("iframe");
     12  document.body.appendChild(iframe);
     13  var initialWindow = iframe.contentWindow;
     14  var initialDocument = initialWindow.document;
     15  assert_equals(initialDocument.URL, "about:blank");
     16  iframe.src = URL;
     17  iframe.onload = this.step_func_done(function() {
     18    assert_equals(iframe.contentWindow, initialWindow);
     19    assert_equals(initialDocument.URL, "about:blank");
     20    var loadedDocument = initialWindow.document;
     21    assert_equals(loadedDocument.URL, location.href.replace(location.pathname, URL));
     22    assert_not_equals(initialDocument, loadedDocument);
     23  });
     24 }, "Document in a browsing context");
     25 </script>