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 authored and TimothyGu committed Aug 15, 2018
1 parent 412533b commit d05bb11
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 d05bb11

Please sign in to comment.