mirror of
https://github.com/servo/servo
synced 2026-05-02 20:32:02 +02:00
Update web-platform-tests to revision 7da6acfd668e66adae5ab4e2d389810d3b1460be
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
<!doctype html>
|
||||
<script>
|
||||
addEventListener("pagehide", parent.t.step_func(function() {parent.pagehide_fired = true}), false);
|
||||
</script>
|
||||
@@ -0,0 +1,2 @@
|
||||
<!doctype html>
|
||||
Filler
|
||||
@@ -0,0 +1,25 @@
|
||||
<!doctype html>
|
||||
<title>pagehide event on unload</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
pagehide_fired = false;
|
||||
var t = async_test();
|
||||
|
||||
onload = function() {setTimeout(function() {
|
||||
var iframe = document.getElementsByTagName("iframe")[0]
|
||||
|
||||
iframe.onload = function() {
|
||||
setTimeout(function() {
|
||||
iframe.contentWindow.location="001-2.html";
|
||||
}, 100);
|
||||
iframe.onload = t.step_func(function() {assert_true(pagehide_fired); t.done()});
|
||||
};
|
||||
|
||||
iframe.src = "001-1.html?" + Math.random();
|
||||
|
||||
}, 100)};
|
||||
|
||||
</script>
|
||||
<iframe></iframe>
|
||||
@@ -0,0 +1,4 @@
|
||||
<!doctype html>
|
||||
<script>
|
||||
addEventListener("pagehide", parent.t.step_func(parent.do_test()), false);
|
||||
</script>
|
||||
@@ -0,0 +1,33 @@
|
||||
<!doctype html>
|
||||
<title>pagehide event properties</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
var t = async_test();
|
||||
|
||||
onload = function() {setTimeout(function() {
|
||||
var iframe = document.getElementsByTagName("iframe")[0]
|
||||
|
||||
iframe.onload = function() {
|
||||
setTimeout(function() {
|
||||
iframe.contentWindow.location="001-2.html";
|
||||
}, 100);
|
||||
iframe.onload = t.step_func(function() {t.done()});
|
||||
};
|
||||
|
||||
function do_test(e) {
|
||||
assert_equals(e.type, "pagehide");
|
||||
assert_equals(e.target, iframe.contentDocument);
|
||||
assert_equals(e.currentTarget, iframe.contentWindow);
|
||||
assert_false(e.bubbles, "bubbles");
|
||||
assert_false(e.cancelable, "cancelable");
|
||||
assert_true(e.persisted, "persisted");
|
||||
}
|
||||
|
||||
iframe.src = "002-1.html?" + Math.random();
|
||||
|
||||
}, 100)};
|
||||
|
||||
</script>
|
||||
<iframe></iframe>
|
||||
@@ -0,0 +1,4 @@
|
||||
<!doctype html>
|
||||
<script>
|
||||
addEventListener("unload", parent.t.step_func(function(e) {parent.do_test(e)}), false);
|
||||
</script>
|
||||
@@ -0,0 +1,33 @@
|
||||
<!doctype html>
|
||||
<title>unload event properties</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
var t = async_test();
|
||||
var do_test;
|
||||
|
||||
onload = function() {setTimeout(function() {
|
||||
var iframe = document.getElementsByTagName("iframe")[0]
|
||||
|
||||
iframe.onload = function() {
|
||||
setTimeout(function() {
|
||||
iframe.contentWindow.location="002-2.html";
|
||||
}, 100);
|
||||
iframe.onload = t.step_func(function() {t.done()});
|
||||
};
|
||||
|
||||
do_test = function(e) {
|
||||
assert_equals(e.type, "unload");
|
||||
assert_equals(e.target, iframe.contentDocument);
|
||||
assert_equals(e.currentTarget, iframe.contentWindow);
|
||||
assert_false(e.bubbles, "bubbles");
|
||||
assert_false(e.cancelable, "cancelable");
|
||||
}
|
||||
|
||||
iframe.src = "003-1.html?" + Math.random();
|
||||
|
||||
}, 100)};
|
||||
|
||||
</script>
|
||||
<iframe></iframe>
|
||||
@@ -0,0 +1,5 @@
|
||||
<!doctype html>
|
||||
<script>
|
||||
addEventListener("pagehide", function() {parent.events.push("pagehide"); setTimeout(function() {parent.events.push("timeout")}, 0)}, false);
|
||||
addEventListener("unload", function() {parent.events.push("unload")}, false);
|
||||
</script>
|
||||
@@ -0,0 +1,28 @@
|
||||
<!doctype html>
|
||||
<title>pagehide / unload event order</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
var t = async_test();
|
||||
|
||||
var events = [];
|
||||
|
||||
onload = function() {setTimeout(function() {
|
||||
var iframe = document.getElementsByTagName("iframe")[0]
|
||||
|
||||
iframe.onload = function() {
|
||||
setTimeout(function() {
|
||||
iframe.contentWindow.location="001-2.html";
|
||||
}, 100);
|
||||
iframe.onload = t.step_func(function() {
|
||||
assert_array_equals(events, ["pagehide", "unload"])
|
||||
t.done()});
|
||||
};
|
||||
|
||||
iframe.src = "004-1.html?" + Math.random();
|
||||
|
||||
}, 100)};
|
||||
|
||||
</script>
|
||||
<iframe></iframe>
|
||||
@@ -0,0 +1,20 @@
|
||||
<!doctype html>
|
||||
006-1
|
||||
<script>
|
||||
onpagehide = function() {
|
||||
onpagehide = null;
|
||||
setTimeout(function() {
|
||||
parent.t.done()
|
||||
}, 1000);
|
||||
}
|
||||
onload = function() {
|
||||
if (!parent.loaded) {
|
||||
parent.loaded = true;
|
||||
setTimeout(parent.t.step_func(
|
||||
function() {
|
||||
location="006-2.html?" + Math.random();
|
||||
}
|
||||
), 100);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,5 @@
|
||||
<!doctype html>
|
||||
006-2
|
||||
<script>
|
||||
onload = function() {setTimeout(parent.t.step_func(function() {history.go(-1)}), 100)}
|
||||
</script>
|
||||
@@ -0,0 +1,18 @@
|
||||
<!doctype html>
|
||||
<title>salvagable state of document after setting pagehide listener</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
var t = async_test();
|
||||
|
||||
var loaded = false;
|
||||
|
||||
onload = function() {setTimeout(function() {
|
||||
var iframe = document.getElementsByTagName("iframe")[0]
|
||||
onload = null;
|
||||
iframe.src="006-1.html?" + Math.random();
|
||||
}, 100)};
|
||||
|
||||
</script>
|
||||
<iframe></iframe>
|
||||
@@ -0,0 +1,21 @@
|
||||
<!doctype html>
|
||||
007-1
|
||||
<script>
|
||||
onunload = function() {
|
||||
onunload = null;
|
||||
parent.unload_fired = true;
|
||||
setTimeout(function() {
|
||||
parent.timeout_fired = true;
|
||||
}, 100);
|
||||
}
|
||||
onload = function() {
|
||||
if (!parent.loaded) {
|
||||
parent.loaded = true;
|
||||
setTimeout(parent.t.step_func(
|
||||
function() {
|
||||
location="007-2.html?" + Math.random();
|
||||
}
|
||||
), 100);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,5 @@
|
||||
<!doctype html>
|
||||
007-2
|
||||
<script>
|
||||
onload = function() {setTimeout(parent.t.step_func(function() {parent.start_test(); history.go(-1)}), 100)}
|
||||
</script>
|
||||
@@ -0,0 +1,28 @@
|
||||
<!doctype html>
|
||||
<title>salvagable state of document after setting unload listener</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
var t = async_test(undefined, {timeout:2000});
|
||||
|
||||
var loaded = false;
|
||||
var unload_fired = false;
|
||||
var timeout_fired = false;
|
||||
|
||||
function start_test() {
|
||||
setTimeout(t.step_func(function() {
|
||||
assert_true(unload_fired);
|
||||
assert_false(timeout_fired);
|
||||
t.done()
|
||||
}), 1000);
|
||||
}
|
||||
|
||||
onload = function() {setTimeout(function() {
|
||||
var iframe = document.getElementsByTagName("iframe")[0]
|
||||
onload = null;
|
||||
iframe.src="007-1.html?" + Math.random();
|
||||
}, 100)};
|
||||
|
||||
</script>
|
||||
<iframe></iframe>
|
||||
@@ -0,0 +1,4 @@
|
||||
<!doctype html>
|
||||
<script>
|
||||
onpagehide = parent.t.step_func(function() {parent.t.done()});
|
||||
</script>
|
||||
@@ -0,0 +1,15 @@
|
||||
<!doctype html>
|
||||
<title>pagehide IDL attribute</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
var iframe;
|
||||
var t = async_test();
|
||||
onload = setTimeout(function() {
|
||||
var iframe = document.getElementsByTagName("iframe")[0];
|
||||
iframe.src="about:blank";
|
||||
setTimeout(t.step_func(function() {assert_unreached();}), 1000)
|
||||
}, 100)
|
||||
</script>
|
||||
<iframe src="008-1.html"></iframe>
|
||||
@@ -0,0 +1,4 @@
|
||||
<!doctype html>
|
||||
<script>
|
||||
onunload = parent.t.step_func(function() {parent.t.done()});
|
||||
</script>
|
||||
@@ -0,0 +1,15 @@
|
||||
<!doctype html>
|
||||
<title>unload IDL attribute</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
var iframe;
|
||||
var t = async_test();
|
||||
onload = setTimeout(function() {
|
||||
var iframe = document.getElementsByTagName("iframe")[0];
|
||||
iframe.src="about:blank";
|
||||
setTimeout(t.step_func(function() {assert_unreached();}), 1000)
|
||||
}, 100)
|
||||
</script>
|
||||
<iframe src="009-1.html"></iframe>
|
||||
@@ -0,0 +1,21 @@
|
||||
support 001-1.html
|
||||
support 001-2.html
|
||||
001.html
|
||||
support 002-1.html
|
||||
002.html
|
||||
support 003-1.html
|
||||
003.html
|
||||
support 004-1.html
|
||||
004.html
|
||||
support 006-1.html
|
||||
support 006-2.html
|
||||
006.html
|
||||
support 007-1.html
|
||||
support 007-2.html
|
||||
007.html
|
||||
support 008-1.html
|
||||
008.html
|
||||
support 009-1.html
|
||||
009.html
|
||||
manual manual-001-1.html
|
||||
manual manual-001.html
|
||||
@@ -0,0 +1,2 @@
|
||||
<!doctype html>
|
||||
<p>Now go back. PASS should be displayed after a short pause
|
||||
@@ -0,0 +1,5 @@
|
||||
<!doctype html>
|
||||
<title>Document salvagable state after setting pagehide handler</title>
|
||||
<script>onpagehide = function() {setTimeout(function(){document.body.innerHTML = "PASS"}, 100)}</script>
|
||||
<p>Click the link below then navigate back to this page. Shortly after returning you should see the text "PASS"</p>
|
||||
<p><A href="manual-001-1.html">Click here</a>
|
||||
Reference in New Issue
Block a user