Bug 1558682 [wpt PR 17278] - Assert that `visibilitychange` event bubbles, a=testonly

Automatic update from web-platform-tests
Assert that `visibilitychange` event bubbles

--
Move pop-up documents to resources/

--
Remove unused statement

--

wpt-commits: 9dc0854f96b351813babc0529a7a313c51e06e94, 1df71f303422d3cc98602ae3ee1168a8d044c110, c2c26462a2dc136ced644fc04f8baaf7ac178312
wpt-pr: 17278


--HG--
rename : testing/web-platform/tests/page-visibility/unload-1.html => testing/web-platform/tests/page-visibility/resources/unload.html
This commit is contained in:
Aleksey Shvayka 2019-07-19 12:39:03 +00:00 коммит произвёл James Graham
Родитель 561d4c5cdf
Коммит 902dc56207
5 изменённых файлов: 34 добавлений и 2 удалений

Просмотреть файл

@ -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() {

Просмотреть файл

@ -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>

Просмотреть файл

@ -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>

Просмотреть файл

@ -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();