Skip to content

Commit

Permalink
Bug 1484354 [wpt PR 12555] - HTML: document.open() and reload, a=test…
Browse files Browse the repository at this point in the history
…only

Automatic update from web-platform-testsHTML: document.open() and reload (#12555)

For whatwg/html#3946.
--

wpt-commits: 8b0c29bfa35d03c3db9027af796abcdb08b7c6dc
wpt-pr: 12555

UltraBlame original commit: 2e120ceb2b8b1c22b178afaa22ed6d418cab9770
  • Loading branch information
marco-c committed Oct 3, 2019
1 parent 8c497a5 commit f4b2a72
Show file tree
Hide file tree
Showing 3 changed files with 92 additions and 0 deletions.
19 changes: 19 additions & 0 deletions testing/web-platform/meta/MANIFEST.json
Original file line number Diff line number Diff line change
Expand Up @@ -289065,6 +289065,11 @@
{}
]
],
"html/webappapis/dynamic-markup-insertion/opening-the-input-stream/resources/dummy.html": [
[
{}
]
],
"html/webappapis/dynamic-markup-insertion/opening-the-input-stream/resources/encoding-frame.html": [
[
{}
Expand Down Expand Up @@ -365648,6 +365653,12 @@
{}
]
],
"html/webappapis/dynamic-markup-insertion/opening-the-input-stream/reload.window.js": [
[
"/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/reload.window.html",
{}
]
],
"html/webappapis/dynamic-markup-insertion/opening-the-input-stream/tasks.window.js": [
[
"/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/tasks.window.html",
Expand Down Expand Up @@ -606723,6 +606734,10 @@
"5e5ca80781809cc509a8eade7ea91e74de92f9a8",
"testharness"
],
"html/webappapis/dynamic-markup-insertion/opening-the-input-stream/reload.window.js": [
"d6ff9dc7a45425cb688ed4b6c9ea2ab5c1c3ae5c",
"testharness"
],
"html/webappapis/dynamic-markup-insertion/opening-the-input-stream/resources/aborted-parser-async-frame.html": [
"d5535630be05ddb466814c503ab086d7176ecbda",
"support"
Expand Down Expand Up @@ -606755,6 +606770,10 @@
"7cb86dcba0236d1e161989e95de172ebbf7852e0",
"support"
],
"html/webappapis/dynamic-markup-insertion/opening-the-input-stream/resources/dummy.html": [
"a092f4e2d7e6d577f61b85ae6d3107793b080120",
"support"
],
"html/webappapis/dynamic-markup-insertion/opening-the-input-stream/resources/encoding-frame.html": [
"843c3a2c7988be0b9595bc69887fc75a5a7b304c",
"support"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@

















if (!opener) {
async_test(t => {
const testURL = document.URL;
const dummyURL = new URL("resources/dummy.html", document.URL).href;


const win = window.open("resources/dummy.html");
t.add_cleanup(() => { win.close(); });

win.addEventListener("load", t.step_func(() => {


t.step_timeout(() => {
const doc = win.document;
assert_true(doc.body.textContent.includes("Dummy"), "precondition");
assert_equals(doc.URL, dummyURL, "precondition");

window.onChildLoad = t.step_func(message => {



assert_equals(message, "Written", "script on written page is executed");
assert_true(win.document.body.textContent.includes("Content"), "page is written to");
assert_equals(win.document.URL, testURL, "postcondition: after document.write()");
assert_equals(win.document, doc, "document.open should not change the document object");
window.onChildLoad = t.step_func_done(message => {



assert_equals(message, "Done!", "actual test");
assert_true(win.document.body.textContent.includes("Back to the test"), "test is reloaded");
assert_equals(win.document.URL, testURL, "postcondition: after reload");
assert_not_equals(win.document, doc, "reload should change the document object");
});



win.location.reload();
});


assert_equals(doc.open(), doc);
assert_equals(doc.URL, testURL, "postcondition: after document.open()");
doc.write("<p>Content</p><script>opener.onChildLoad('Written');</script>");
doc.close();
}, 100);
}), { once: true });
}, "Reloading a document.open()'d page should reload the URL of the entry realm's responsible document");
} else {
document.write("<p>Back to the test</p>");


opener.onChildLoad("Done!");
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

<p>Dummy</p>

0 comments on commit f4b2a72

Please sign in to comment.