Update web-platform-tests to revision 7a767a52741f628430ffbbed46e7f3df68ba3534

Fixes #15648.
This commit is contained in:
Ms2ger 2017-02-20 11:44:42 +01:00
parent a1e4c547f0
commit 4fadf9b0b6
1184 changed files with 22551 additions and 9856 deletions

View file

@ -1,33 +0,0 @@
support 001-1.html
support 001a.html
support 001b.html
001.html
support 002-1.html
support 002a.html
support 002b.html
002.html
support 003-1.html
support 003a.html
support 003b.html
003.html
support 004-1.html
support 004a.html
support 004b.html
004.html
support 005-1.html
support 005a.html
support 005b.html
005.html
base.html
support beforeunload-on-history-back-1.html
beforeunload-on-history-back.html
support beforeunload-on-navigation-of-parent-1.html
support beforeunload-on-navigation-of-parent-2.html
beforeunload-on-navigation-of-parent.html
support navigation-within-beforeunload-1.html
support navigation-within-beforeunload-2.html
navigation-within-beforeunload.html
support pagehide-on-history-forward-1.html
pagehide-on-history-forward.html
dir prompt
dir unload

View file

@ -0,0 +1,31 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>Support page for beforeunload-canceling.html</title>
<h1>If this goes away, it navigated</h1>
<script>
"use strict";
window.runTest = (t, { valueToReturn, expectCancelation, setReturnValue, expectedReturnValue }) => {
window.onbeforeunload = t.step_func(e => {
if (setReturnValue !== undefined) {
e.returnValue = setReturnValue;
}
return valueToReturn;
});
const listener = t.step_func(e => {
top.assert_equals(e.defaultPrevented, expectCancelation, "canceled");
top.assert_equals(e.returnValue, expectedReturnValue, "returnValue");
window.onbeforeunload = null;
t.done();
});
window.addEventListener("beforeunload", listener);
window.location.href = "about:blank";
};
</script>

View file

@ -0,0 +1,142 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>beforeunload return value cancelation behavior</title>
<link rel="help" href="https://html.spec.whatwg.org/multipage/webappapis.html#the-event-handler-processing-algorithm">
<link rel="author" title="Domenic Denicola" href="mailto:d@domenic.me">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
"use strict";
async_test(t => {
let onbeforeunloadHappened = false;
window.onbeforeunload = t.step_func(() => {
onbeforeunloadHappened = true;
return "cancel me";
});
const listener = t.step_func(e => {
assert_true(onbeforeunloadHappened, "CustomEvent must be able to trigger the event handler");
assert_false(e.defaultPrevented, "The event must not have been canceled");
window.onbeforeunload = null;
t.done();
});
window.addEventListener("beforeunload", listener);
window.dispatchEvent(new CustomEvent("beforeunload"));
}, "Returning a string must not cancel the event: CustomEvent, non-cancelable");
async_test(t => {
let onbeforeunloadHappened = false;
window.onbeforeunload = t.step_func(() => {
onbeforeunloadHappened = true;
return "cancel me";
});
const listener = t.step_func(e => {
assert_true(onbeforeunloadHappened, "CustomEvent must be able to trigger the event handler");
assert_false(e.defaultPrevented, "The event must not have been canceled");
window.onbeforeunload = null;
t.done();
});
window.addEventListener("beforeunload", listener);
window.dispatchEvent(new CustomEvent("beforeunload", { cancelable: true }));
}, "Returning a string must not cancel the event: CustomEvent, cancelable");
const testCases = [
{
valueToReturn: null,
expectCancelation: false,
expectedReturnValue: ""
},
{
valueToReturn: undefined,
expectCancelation: false,
expectedReturnValue: ""
},
{
valueToReturn: "",
expectCancelation: true,
expectedReturnValue: ""
},
{
valueToReturn: false,
expectCancelation: true,
expectedReturnValue: "false"
},
{
valueToReturn: true,
expectCancelation: true,
expectedReturnValue: "true"
},
{
valueToReturn: 0,
expectCancelation: true,
expectedReturnValue: "0"
},
{
valueToReturn: null,
expectCancelation: false,
setReturnValue: "foo",
expectedReturnValue: "foo"
},
{
valueToReturn: undefined,
expectCancelation: false,
setReturnValue: "foo",
expectedReturnValue: "foo"
},
{
valueToReturn: "",
expectCancelation: true,
setReturnValue: "foo",
expectedReturnValue: "foo"
},
{
valueToReturn: false,
expectCancelation: true,
setReturnValue: "foo",
expectedReturnValue: "foo"
},
{
valueToReturn: true,
expectCancelation: true,
setReturnValue: "foo",
expectedReturnValue: "foo"
},
{
valueToReturn: 0,
expectCancelation: true,
setReturnValue: "foo",
expectedReturnValue: "foo"
}
];
var testCaseIndex = 0;
function runNextTest() {
const testCase = testCases[testCaseIndex];
const labelAboutReturnValue = testCase.setReturnValue === undefined ? "" :
`; setting returnValue to ${testCase.setReturnValue}`;
async_test(t => {
const iframe = document.createElement("iframe");
iframe.onload = t.step_func(() => {
iframe.contentWindow.runTest(t, testCase);
if (++testCaseIndex < testCases.length)
runNextTest();
});
iframe.src = "beforeunload-canceling-1.html";
document.body.appendChild(iframe);
}, `Returning ${testCase.valueToReturn} with a real iframe unloading${labelAboutReturnValue}`);
}
runNextTest();
</script>

View file

@ -1,14 +0,0 @@
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

@ -1,21 +0,0 @@
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