tor-browser

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

url-entry-document.window.js (1037B)


      1 async_test(t => {
      2  const frame = document.body.appendChild(document.createElement("iframe"));
      3  t.add_cleanup(() => frame.remove());
      4  const frameURL = new URL("resources/url-entry-document-timer-frame.html", document.URL).href;
      5  window.timerTest = t.step_func_done(() => {
      6    assert_equals(frame.contentDocument.URL, frameURL);
      7    assert_equals(frame.contentWindow.location.href, frameURL);
      8 
      9    // In this case, the entry settings object was set when this function is
     10    // executed in the timer task through Web IDL's "invoke a callback
     11    // function" algorithm, to be the relevant settings object of this
     12    // function. Therefore the URL of this document would be inherited.
     13    assert_equals(frame.contentDocument.open(), frame.contentDocument);
     14    assert_equals(frame.contentDocument.URL, document.URL);
     15    assert_equals(frame.contentWindow.location.href, document.URL);
     16  });
     17  frame.src = frameURL;
     18 }, "document.open() changes document's URL to the entry settings object's responsible document's (through timeouts)");