Skip to content

Commit

Permalink
https:/whatwg/html/issues/3885
Browse files Browse the repository at this point in the history
  • Loading branch information
TimothyGu committed Aug 17, 2018
1 parent c5698e5 commit 0c908fe
Showing 1 changed file with 23 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
async_test(t => {
const frame = document.body.appendChild(document.createElement("iframe"));
frame.src = "/common/blank.html";
frame.addEventListener("load", t.step_func(() => {
t.step_timeout(() => {
assert_equals(frame.contentDocument.body.childNodes.length, 0, "precondition");
frame.contentDocument.open();
frame.contentDocument.write("<p>Content</p>");
frame.contentDocument.close();
frame.contentWindow.location.reload();
frame.addEventListener("load", t.step_func_done(() => {
assert_equals(frame.contentDocument.body.childNodes.length, 0, "actual test");
}));
}, 100);
}), { once: true });
}, "Reloading a document.open()'d page should give original results");
const sharedSymbol = Symbol.for('Test status');

if (this === top) {
async_test(t => {
const frame = document.body.appendChild(document.createElement("iframe"));
t.add_cleanup(() => frame.remove());
frame.src = "/common/blank.html";
frame.addEventListener("load", t.step_func(() => {
t.step_timeout(() => {
assert_equals(frame.contentDocument.body.childNodes.length, 0, "precondition");
frame.contentDocument.open();
frame.contentDocument.write("<p>Content</p>");
frame.contentDocument.close();
frame.addEventListener("load", t.step_func_done(() => {
assert_equals(frame.contentWindow[sharedSymbol], "Done!", "actual test");
}));
frame.contentWindow.location.reload();
}, 100);
}), { once: true });
}, "Reloading a document.open()'d page should reload the URL of the entry realm's responsible document");
} else {
window[sharedSymbol] = "Done!";
}

0 comments on commit 0c908fe

Please sign in to comment.