tor-browser

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

url-entry-document-sync-call.window.js (681B)


      1 for (const methodName of ["open", "write", "writeln"]) {
      2  async_test(t => {
      3    const frame = document.body.appendChild(document.createElement("iframe"));
      4    t.add_cleanup(() => { frame.remove(); });
      5    const frameURL = new URL("resources/url-entry-document-incumbent-frame.html", document.URL).href;
      6    frame.onload = t.step_func_done(() => {
      7      assert_equals(frame.contentDocument.URL, frameURL);
      8      frame.contentWindow.callDocumentMethod(methodName);
      9      assert_equals(frame.contentDocument.URL, document.URL);
     10    });
     11    frame.src = frameURL;
     12  }, `document.${methodName}() changes document's URL to the entry global object's associate document's (sync call)`);
     13 }