summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/url-entry-document.window.js
blob: c3a1c3a874f3577716d3d8075b2e91a5d257ad43 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
async_test(t => {
  const frame = document.body.appendChild(document.createElement("iframe"));
  t.add_cleanup(() => frame.remove());
  const frameURL = new URL("resources/url-entry-document-timer-frame.html", document.URL).href;
  window.timerTest = t.step_func_done(() => {
    assert_equals(frame.contentDocument.URL, frameURL);
    assert_equals(frame.contentWindow.location.href, frameURL);

    // In this case, the entry settings object was set when this function is
    // executed in the timer task through Web IDL's "invoke a callback
    // function" algorithm, to be the relevant settings object of this
    // function. Therefore the URL of this document would be inherited.
    assert_equals(frame.contentDocument.open(), frame.contentDocument);
    assert_equals(frame.contentDocument.URL, document.URL);
    assert_equals(frame.contentWindow.location.href, document.URL);
  });
  frame.src = frameURL;
}, "document.open() changes document's URL to the entry settings object's responsible document's (through timeouts)");