Skip to content

Commit

Permalink
HTML: document.open() and global variables
Browse files Browse the repository at this point in the history
  • Loading branch information
annevk committed May 3, 2018
1 parent 7a7d2e1 commit 3b06a0c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<!doctype html>
<script>
hey = "You";
</script>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
async_test(t => {
const frame = document.body.appendChild(document.createElement("iframe"));
frame.src = "resources/variables-frame.html";
frame.onload = t.step_func_done(() => {
assert_equals(frame.contentWindow.hey, "You", "precondition");
frame.contentDocument.open();
assert_equals(frame.contentWindow.hey, "You", "actual check");
// Ensure a load event gets dispatched to unblock testharness
frame.contentDocument.close();
});
}, "Obtaining a variable from a global whose document had open() invoked");

0 comments on commit 3b06a0c

Please sign in to comment.