Update web-platform-tests to revision 50d6ee076e94273080d9f3b69be0bf4eeae156d3

This commit is contained in:
WPT Sync Bot 2018-08-22 21:45:47 -04:00
parent 3b9055510a
commit 280c87822d
331 changed files with 4209 additions and 866 deletions

View file

@ -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();

View file

@ -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>

View file

@ -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/";