summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/url-entry-document-sync-call.window.js
blob: f20b4341e36cb2bba00f21e452c0e6bcfa529238 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
for (const methodName of ["open", "write", "writeln"]) {
  async_test(t => {
    const frame = document.body.appendChild(document.createElement("iframe"));
    t.add_cleanup(() => { frame.remove(); });
    const frameURL = new URL("resources/url-entry-document-incumbent-frame.html", document.URL).href;
    frame.onload = t.step_func_done(() => {
      assert_equals(frame.contentDocument.URL, frameURL);
      frame.contentWindow.callDocumentMethod(methodName);
      assert_equals(frame.contentDocument.URL, document.URL);
    });
    frame.src = frameURL;
  }, `document.${methodName}() changes document's URL to the entry global object's associate document's (sync call)`);
}