Update web-platform-tests to revision 7da6acfd668e66adae5ab4e2d389810d3b1460be

This commit is contained in:
James Graham
2015-10-05 17:15:15 +01:00
parent 50db64a20e
commit bae87d193d
307 changed files with 35826 additions and 209 deletions

View File

@@ -0,0 +1,10 @@
<script>
addEventListener("beforeunload",
function() {
parent.events.push("beforeunload");
}, false);
parent.events.push("before src change");
location.href = "001-2.html&pipe=trickle(d2)";
parent.events.push("after src change");
</script>

View File

@@ -0,0 +1,14 @@
<!doctype html>
<title>beforeunload event order</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
var t = async_test();
events = [];
onload = t.step_func(function() {
assert_array_equals(events, ["before src change", "beforeunload", "after src change"]);
t.done();
})
</script>
<iframe src="001-1.html"></iframe>

View File

@@ -0,0 +1,7 @@
<script>
addEventListsner("beforeunload", parent.t.step_func(
function(e) {
parent.do_test(e);
}, false);
location.href = "001-2.html&pipe=trickle(d2)";
</script>

View File

@@ -0,0 +1,20 @@
<!doctype html>
<title>beforeunload event properties</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
var t = async_test();
function do_test(e) {
assert_equals(e.type, "beforeunload");
assert_false(e.bubbles, "bubbles");
assert_true(e.cancelable, "bubbles");
assert_equals(e.returnValue, "");
}
onload = t.step_func(function() {
t.done();
})
</script>
<iframe src="001-1.html"></iframe>

View File

@@ -0,0 +1,20 @@
<!doctype html>
<title>beforeunload event in child frame for parent navigation</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
var t = async_test();
function do_test(e) {
assert_equals(e.type, "beforeunload");
assert_false(e.bubbles, "bubbles");
assert_true(e.cancelable, "bubbles");
assert_equals(e.returnValue, "");
}
onload = t.step_func(function() {
t.done();
})
</script>
<iframe src="001-1.html"></iframe>

View File

@@ -0,0 +1,14 @@
support 001-1.html
support 001-2.html
001.html
support 002-1.html
002.html
003.html
manual manual-001.html
manual manual-002.html
manual manual-003.html
manual manual-004.html
manual manual-005.html
manual manual-006.html
support next.html
support slice-and-dice.php

View File

@@ -0,0 +1,9 @@
<!doctype html>
<title>Prompt when beforeunload is canceled</title>
<script>
addEventListener("beforeunload",
function(e) {e.preventDefault()},
false);
</script>
<p>When clicking the link below, you should get a prompt asking if you want to unload the document</p>
<a href="next.html">Click here</a>

View File

@@ -0,0 +1,9 @@
<!doctype html>
<title>Prompt when beforeunload has returnValue set</title>
<script>
addEventListener("beforeunload",
function(e) {e.returnValue = "PASS if you see this"},
false);
</script>
<p>When clicking the link below, you should get a prompt asking if you want to unload the document</p>
<a href="next.html">Click here</a>

View File

@@ -0,0 +1,11 @@
<!doctype html>
<title>Prompt when beforeunload is canceled</title>
<script>
addEventListener("beforeunload",
function(e) {e.preventDefault()},
false);
</script>
<p>When clicking the button below, you should get a prompt asking if you want to unload the document</p>
<form method="get" action="next.html">
<input type="submit" value="Click here">
</form>

View File

@@ -0,0 +1,11 @@
<!doctype html>
<title>Prompt on form submit</title>
<script>
addEventListener("beforeunload",
function(e) {e.preventDefault()},
false);
</script>
<p>When clicking the button below, you should get a prompt asking if you want to unload the document</p>
<form method="get" action="next.html">
<input type="submit" value="Click here">
</form>

View File

@@ -0,0 +1,22 @@
<!doctype html>
<title>Event loop pause for beforeunload</title>
<script>
var counter = 0;
onload = function count() {
document.getElementById("log").textContent = counter++
setTimeout(count, 200);
}
addEventListener("beforeunload",
function(e) {
e.preventDefault()
},
false);
</script>
<ul>
<li>Click on the link below. When the prompt appears the counter at the bottom must stop incrementing.
<li>Opt not to leave the page. The counter must start incrementing again
</ul>
<p><a href="">Click here</a>
<div id="log"></div>

View File

@@ -0,0 +1,9 @@
<!doctype html>
<title>Prompt when beforeunload returns string value</title>
<script>
addEventListener("beforeunload",
function(e) {return "PASS if you see this"},
false);
</script>
<p>When clicking the link below, you should get a prompt asking if you want to unload the document</p>
<a href="next.html">Click here</a>

View File

@@ -0,0 +1,2 @@
<!doctype html>
<p>You should have seen a prompt asking you to unload the previous document