зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
561d4c5cdf
Коммит
902dc56207
|
@ -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();
|
||||
|
|
Загрузка…
Ссылка в новой задаче