Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assert that visibilitychange event bubbles #17278

Merged
merged 3 commits into from Jun 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion page-visibility/onvisibilitychange.html
Expand Up @@ -5,7 +5,6 @@
<div id="log"></div>
<script>
var ast = new async_test("onvisibilitychange attribute is a proper event handler");
document.getElementById("frame1");
function startTest() {
var iframe1 = document.getElementById("frame1");
iframe1.contentWindow.document.onvisibilitychange = ast.step_func(function() {
Expand Down
15 changes: 15 additions & 0 deletions page-visibility/resources/unload-bubbles.html
@@ -0,0 +1,15 @@
<!doctype html>
<html>
<head><title>Document</title></head>
<body>
<h1>Document</h1>
<script>
window.addEventListener("load", function() {
window.addEventListener("visibilitychange", function() {
opener.postMessage(document.visibilityState, "*");
});
opener.postMessage("close", "*");
});
</script>
</body>
</html>
File renamed without changes.
18 changes: 18 additions & 0 deletions page-visibility/unload-bubbles.html
@@ -0,0 +1,18 @@
<!doctype html>
<title>visibilitychange event bubbles when fired on unload</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
async_test(function(t) {
var w = window.open("resources/unload-bubbles.html");
window.onmessage = t.step_func(function(event) {
if (event.data === "close") {
w.close();
return;
}
assert_equals(event.data, "hidden");
t.done();
});
});
</script>
2 changes: 1 addition & 1 deletion page-visibility/unload.html
Expand Up @@ -5,7 +5,7 @@
<div id="log"></div>
<script>
async_test(function(t) {
var w = window.open("unload-1.html");
var w = window.open("resources/unload.html");
window.onmessage = t.step_func(function(event) {
if (event.data === "close") {
w.close();
Expand Down