mirror of
https://github.com/servo/servo.git
synced 2025-08-18 03:45:33 +01:00
Update web-platform-tests to revision 50d6ee076e94273080d9f3b69be0bf4eeae156d3
This commit is contained in:
parent
3b9055510a
commit
280c87822d
331 changed files with 4209 additions and 866 deletions
|
@ -0,0 +1,37 @@
|
|||
// META: script=/common/get-host-info.sub.js
|
||||
|
||||
const BASE = location.href;
|
||||
const IS_HTTPS = new URL(BASE).protocol === 'https:';
|
||||
const REMOTE_HOST = get_host_info()['REMOTE_HOST'];
|
||||
const REMOTE_PORT =
|
||||
IS_HTTPS ? get_host_info()['HTTPS_PORT'] : get_host_info()['HTTP_PORT'];
|
||||
|
||||
const REMOTE_ORIGIN =
|
||||
new URL(`//${REMOTE_HOST}:${REMOTE_PORT}`, BASE).origin;
|
||||
const DESTINATION = new URL('../resources/cors-top.txt', BASE);
|
||||
|
||||
function CreateURL(url, BASE, params) {
|
||||
const u = new URL(url, BASE);
|
||||
for (const {name, value} of params) {
|
||||
u.searchParams.append(name, value);
|
||||
}
|
||||
return u;
|
||||
}
|
||||
|
||||
const redirect =
|
||||
CreateURL('/fetch/api/resources/redirect.py', REMOTE_ORIGIN,
|
||||
[{name: 'redirect_status', value: 303},
|
||||
{name: 'location', value: DESTINATION.href}]);
|
||||
|
||||
promise_test(async (test) => {
|
||||
const res = await fetch(redirect.href, {mode: 'no-cors'});
|
||||
// This is discussed at https://github.com/whatwg/fetch/issues/737.
|
||||
assert_equals(res.type, 'opaque');
|
||||
}, 'original => remote => original with mode: "no-cors"');
|
||||
|
||||
promise_test(async (test) => {
|
||||
const res = await fetch(redirect.href, {mode: 'cors'});
|
||||
assert_equals(res.type, 'cors');
|
||||
}, 'original => remote => original with mode: "cors"');
|
||||
|
||||
done();
|
|
@ -1,12 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<title>Cross-Origin-Resource-Policy in Service Worker</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/service-workers/service-worker/resources/test-helpers.sub.js"></script>
|
||||
<script>
|
||||
|
||||
service_worker_test(
|
||||
'fetch.any.js',
|
||||
'fetch.any.js test');
|
||||
|
||||
</script>
|
|
@ -1,10 +1,5 @@
|
|||
// META: global=window,worker
|
||||
// META: script=/common/get-host-info.sub.js
|
||||
// META: script=/resources/testharness.js
|
||||
|
||||
if (!self.document) {
|
||||
importScripts("/resources/testharness.js");
|
||||
importScripts("/common/get-host-info.sub.js");
|
||||
}
|
||||
|
||||
const host = get_host_info();
|
||||
const path = "/fetch/cross-origin-resource-policy/";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue