Update web-platform-tests to revision cf261625e2d230ab219eec966f4abe26e3401b64

This commit is contained in:
WPT Sync Bot 2018-05-29 21:17:45 -04:00
parent 11a89bcc47
commit 8f98acd0e7
297 changed files with 3396 additions and 1555 deletions

View file

@ -106,7 +106,7 @@
checkRequestWithEmptyBody("blob", new Blob([], { "type" : "text/plain" }), true);
checkRequestWithEmptyBody("text", "", true);
checkRequestWithEmptyBody("URLSearchParams", new URLSearchParams(""), true);
// FIXME: This test assumes that the empty string be returned but it is not clear whether that is right. See https://github.com/w3c/web-platform-tests/pull/3950.
// FIXME: This test assumes that the empty string be returned but it is not clear whether that is right. See https://github.com/web-platform-tests/wpt/pull/3950.
checkRequestWithEmptyBody("FormData", new FormData(), true);
checkRequestWithEmptyBody("ArrayBuffer", new ArrayBuffer(), true);
</script>

View file

@ -7,6 +7,10 @@
<script>
const worker = 'resources/request-reset-attributes-worker.js';
function wait(ms) {
return new Promise(resolve => step_timeout(resolve, ms));
}
promise_test(async (t) => {
const scope = 'resources/hello.txt?name=isReloadNavigation';
let frame;
@ -33,4 +37,60 @@ promise_test(async (t) => {
}
}
}, 'Request.isReloadNavigation is reset with non-empty RequestInit');
promise_test(async (t) => {
const scope = 'resources/hello.html?name=isHistoryNavigation';
let frame;
let reg;
try {
reg = await service_worker_unregister_and_register(t, worker, scope);
await wait_for_state(t, reg.installing, 'activated');
frame = await with_iframe(scope);
assert_equals(frame.contentDocument.body.textContent,
'old: false, new: false');
// Use step_timeout(0) to ensure the history entry is created for Blink
// and WebKit. See https://bugs.webkit.org/show_bug.cgi?id=42861.
await wait(0);
await new Promise((resolve) => {
frame.onload = resolve;
frame.src = 'resources/hello.html?ignore';
});
await wait(0);
await new Promise((resolve) => {
frame.onload = resolve;
frame.contentWindow.history.go(-1);
});
assert_equals(frame.contentDocument.body.textContent,
'old: true, new: false');
} finally {
if (frame) {
frame.remove();
}
if (reg) {
await reg.unregister();
}
}
}, 'Request.isHistoryNavigation is reset with non-empty RequestInit');
promise_test(async (t) => {
const scope = 'resources/hello.txt?name=mode';
let frame;
let reg;
try {
reg = await service_worker_unregister_and_register(t, worker, scope);
await wait_for_state(t, reg.installing, 'activated');
frame = await with_iframe(scope);
assert_equals(frame.contentDocument.body.textContent,
'old: navigate, new: same-origin');
} finally {
if (frame) {
frame.remove();
}
if (reg) {
await reg.unregister();
}
}
}, 'Request.mode is reset with non-empty RequestInit when it\'s "navigate"');
</script>

View file

@ -30,6 +30,8 @@
"cache",
"redirect",
"integrity",
"isReloadNavigation",
"isHistoryNavigation",
//Request implements Body
"bodyUsed"
];
@ -104,6 +106,11 @@
newValue = true;
break;
case "isHistoryNavigation":
defaultValue = false;
newValue = true;
break;
default:
return;
}