mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Update web-platform-tests to revision cf261625e2d230ab219eec966f4abe26e3401b64
This commit is contained in:
parent
11a89bcc47
commit
8f98acd0e7
297 changed files with 3396 additions and 1555 deletions
|
@ -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>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue