Skip to content

Commit

Permalink
Merge pull request #9891 from w3c/sync_79ca478132d2fb94d3dcd357e480fd…
Browse files Browse the repository at this point in the history
…853c0b944f

Merge pull request #9891 from sync_79ca478132d2fb94d3dcd357e480fd853c0b944f
  • Loading branch information
servo-wpt-sync committed Mar 7, 2018
2 parents a3dd0ce + 79ca478 commit 174b1c7
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions html/syntax/parsing/the-end.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,28 @@
}, "load");

async_test(function() {
var seen = false;
window.addEventListener("pageshow", this.step_func_done(function(e) {
assert_equals(e.type, "pageshow");
assert_false(e.bubbles, "bubbles should be false");
assert_false(e.cancelable, "cancelable should be false");
assert_equals(e.target, document, "target should be document");
assert_true(e.isTrusted, "isTrusted should be true");
assert_class_string(e, "PageTransitionEvent");
}));
}, "pageshow");

async_test(function() {
var seen_dcl = false;
var seen_load = false;
document.addEventListener("DOMContentLoaded", this.step_func(function() {
seen = true;
seen_dcl = true;
}));
window.addEventListener("load", this.step_func(function() {
seen_load = true;
assert_true(seen_dcl, "DOMContentLoaded should be fired before load");
}));
window.addEventListener("load", this.step_func_done(function() {
assert_true(seen, "DOMContentLoaded should be fired before load");
window.addEventListener("pageshow", this.step_func_done(function() {
assert_true(seen_load, "load should be fired before pageshow")
}));
}, "order");
</script>

0 comments on commit 174b1c7

Please sign in to comment.