mirror of
https://github.com/HeyPuter/firefox.git
synced 2026-11-15 14:35:58 -10:00
Automatic update from web-platform-testsFetch: mode "navigate" becomes "same-origin" For https://github.com/whatwg/fetch/pull/377. -- wpt-commits: 864c62d355308cca9ab6d9c939e987cede865d5b wpt-pr: 11176
59 lines
1.8 KiB
HTML
59 lines
1.8 KiB
HTML
<!DOCTYPE html>
|
|
<script src="/resources/testharness.js"></script>
|
|
<script src="/resources/testharnessreport.js"></script>
|
|
<script src="/common/get-host-info.sub.js"></script>
|
|
<script src="/service-workers/service-worker/resources/test-helpers.sub.js"></script>
|
|
<body>
|
|
<script>
|
|
const worker = 'resources/request-reset-attributes-worker.js';
|
|
|
|
promise_test(async (t) => {
|
|
const scope = 'resources/hello.txt?name=isReloadNavigation';
|
|
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');
|
|
await new Promise((resolve) => {
|
|
frame.onload = resolve;
|
|
frame.contentWindow.location.reload();
|
|
});
|
|
assert_equals(frame.contentDocument.body.textContent,
|
|
'old: true, new: false');
|
|
} finally {
|
|
if (frame) {
|
|
frame.remove();
|
|
}
|
|
if (reg) {
|
|
await reg.unregister();
|
|
}
|
|
}
|
|
}, 'Request.isReloadNavigation 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>
|