mirror of
https://github.com/servo/servo.git
synced 2025-08-27 08:08:19 +01:00
Update web-platform-tests to revision 7a6f5673ff5d146ca5c09c6a1b42b7706cfee328
This commit is contained in:
parent
e2fca1b228
commit
4787b28da3
261 changed files with 8195 additions and 4689 deletions
|
@ -6,9 +6,13 @@
|
|||
<meta name="help" href="https://fetch.spec.whatwg.org/#request">
|
||||
<meta name="help" href="https://fetch.spec.whatwg.org/#body-mixin">
|
||||
<meta name="author" title="Microsoft Edge" href="https://www.microsoft.com">
|
||||
<meta name="timeout" content="long">
|
||||
<meta name="variant" content="?include=fast">
|
||||
<meta name="variant" content="?include=slow-1">
|
||||
<meta name="variant" content="?include=slow-2">
|
||||
<meta name="variant" content="?include=slow-3">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/subset-tests-by-key.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
|
@ -38,22 +42,22 @@
|
|||
}
|
||||
|
||||
// Test 1 Byte
|
||||
promise_test(function(test) {
|
||||
subsetTestByKey("fast", promise_test, function(test) {
|
||||
return fetchKeepAliveRequest(noDelay, 1 /* bodySize */);
|
||||
}, 'A Keep-Alive fetch() with a small body should succeed.');
|
||||
|
||||
// Test Quota full limit
|
||||
promise_test(function(test) {
|
||||
subsetTestByKey("fast", promise_test, function(test) {
|
||||
return fetchKeepAliveRequest(noDelay, expectedQuota /* bodySize */);
|
||||
}, 'A Keep-Alive fetch() with a body at the Quota Limit should succeed.');
|
||||
|
||||
// Test Quota + 1 Byte
|
||||
promise_test(function(test) {
|
||||
subsetTestByKey("fast", promise_test, function(test) {
|
||||
return promise_rejects(test, TypeError(), fetchKeepAliveRequest(noDelay, expectedQuota + 1));
|
||||
}, 'A Keep-Alive fetch() with a body over the Quota Limit should reject.');
|
||||
|
||||
// Test the Quota becomes available upon promise completion.
|
||||
promise_test(function (test) {
|
||||
subsetTestByKey("slow-1", promise_test, function (test) {
|
||||
// Fill our Quota then try to send a second fetch.
|
||||
return fetchKeepAliveRequest(standardDelay, expectedQuota).then(() => {
|
||||
// Now validate that we can send another Keep-Alive fetch for the full size of the quota.
|
||||
|
@ -62,7 +66,7 @@
|
|||
}, 'A Keep-Alive fetch() should return its allocated Quota upon promise resolution.');
|
||||
|
||||
// Ensure only the correct amount of Quota becomes available when a fetch completes.
|
||||
promise_test(function(test) {
|
||||
subsetTestByKey("slow-2", promise_test, function(test) {
|
||||
// Create a fetch that uses all but 1 Byte of the Quota and runs for 2x as long as the other requests.
|
||||
const first = fetchKeepAliveRequest(standardDelay * 2, expectedQuota - 1);
|
||||
|
||||
|
@ -79,7 +83,7 @@
|
|||
}, 'A Keep-Alive fetch() should return only its allocated Quota upon promise resolution.');
|
||||
|
||||
// Test rejecting a fetch() after the quota is used up.
|
||||
promise_test(function (test) {
|
||||
subsetTestByKey("slow-3", promise_test, function (test) {
|
||||
// Fill our Quota then try to send a second fetch.
|
||||
const p = fetchKeepAliveRequest(standardDelay, expectedQuota);
|
||||
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
<!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,17 +1,17 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/get-host-info.sub.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
// 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 localBaseURL = host.HTTP_ORIGIN + window.location.pathname.replace(/\/[^\/]*$/, '/') ;
|
||||
const sameSiteBaseURL = "http://" + host.ORIGINAL_HOST + ":" + host.HTTP_PORT2 + window.location.pathname.replace(/\/[^\/]*$/, '/') ;
|
||||
const notSameSiteBaseURL = host.HTTP_NOTSAMESITE_ORIGIN + window.location.pathname.replace(/\/[^\/]*$/, '/') ;
|
||||
const httpsBaseURL = host.HTTPS_ORIGIN + window.location.pathname.replace(/\/[^\/]*$/, '/') ;
|
||||
const path = "/fetch/cross-origin-resource-policy/";
|
||||
const localBaseURL = host.HTTP_ORIGIN + path;
|
||||
const sameSiteBaseURL = "http://" + host.ORIGINAL_HOST + ":" + host.HTTP_PORT2 + path;
|
||||
const notSameSiteBaseURL = host.HTTP_NOTSAMESITE_ORIGIN + path;
|
||||
const httpsBaseURL = host.HTTPS_ORIGIN + path;
|
||||
|
||||
promise_test(async () => {
|
||||
const response = await fetch("./resources/hello.py?corp=same-origin");
|
||||
|
@ -78,6 +78,3 @@ promise_test(async (test) => {
|
|||
|
||||
return promise_rejects(test, new TypeError, fetch(notSameSiteBaseURL + "resources/redirect.py?corp=same-origin&redirectTo=" + encodeURIComponent(finalURL), { mode: "no-cors" }));
|
||||
}, "Cross-origin no-cors fetch with a 'Cross-Origin-Resource-Policy: same-origin' redirect response header.");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue