mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Update web-platform-tests to revision 58eb04cecbbec2e18531ab440225e38944a9c444
This commit is contained in:
parent
25e8bf69e6
commit
665817d2a6
35333 changed files with 1818077 additions and 16036 deletions
|
@ -1,16 +0,0 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Fetch in worker: accept header</title>
|
||||
<meta name="help" href="https://fetch.spec.whatwg.org/#fetching">
|
||||
<meta name="author" title="Canon Research France" href="https://www.crf.canon.fr">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
fetch_tests_from_worker(new Worker("accept-header.js"));
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,7 +1,4 @@
|
|||
if (this.document === undefined) {
|
||||
importScripts("/resources/testharness.js");
|
||||
importScripts("../resources/utils.js");
|
||||
}
|
||||
// META: script=../resources/utils.js
|
||||
|
||||
promise_test(function() {
|
||||
return fetch(RESOURCES_DIR + "inspect-headers.py?headers=Accept").then(function(response) {
|
||||
|
@ -34,5 +31,3 @@ promise_test(function() {
|
|||
assert_equals(response.headers.get("x-request-accept-language"), "bzh", "Request has accept header with value 'bzh'");
|
||||
});
|
||||
}, "Request through fetch should have 'accept-language' header with value 'bzh'");
|
||||
|
||||
done();
|
|
@ -1,15 +0,0 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Fetch: accept header</title>
|
||||
<meta name="help" href="https://fetch.spec.whatwg.org/#fetching">
|
||||
<meta name="author" title="Canon Research France" href="https://www.crf.canon.fr">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script src="../resources/utils.js"></script>
|
||||
<script src="accept-header.js"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,17 +0,0 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Fetch in worker: same-origin mode</title>
|
||||
<meta name="help" href="https://fetch.spec.whatwg.org/#main-fetch">
|
||||
<meta name="help" href="https://fetch.spec.whatwg.org/#basic-fetch">
|
||||
<meta name="author" title="Canon Research France" href="https://www.crf.canon.fr">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
fetch_tests_from_worker(new Worker("mode-same-origin.js"));
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,8 +1,5 @@
|
|||
if (this.document === undefined) {
|
||||
importScripts("/resources/testharness.js");
|
||||
importScripts("../resources/utils.js");
|
||||
importScripts("/common/get-host-info.sub.js")
|
||||
}
|
||||
// META: script=../resources/utils.js
|
||||
// META: script=/common/get-host-info.sub.js
|
||||
|
||||
function fetchSameOrigin(url, shouldPass) {
|
||||
promise_test(function(test) {
|
||||
|
@ -29,6 +26,3 @@ fetchSameOrigin(redirPath + RESOURCES_DIR + "top.txt", true);
|
|||
fetchSameOrigin(redirPath + host_info.HTTP_ORIGIN + "/fetch/api/resources/top.txt", true);
|
||||
fetchSameOrigin(redirPath + host_info.HTTPS_ORIGIN + "/fetch/api/resources/top.txt", false);
|
||||
fetchSameOrigin(redirPath + host_info.HTTP_REMOTE_ORIGIN + "/fetch/api/resources/top.txt", false);
|
||||
|
||||
done();
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Fetch: same-origin mode</title>
|
||||
<meta name="help" href="https://fetch.spec.whatwg.org/#main-fetch">
|
||||
<meta name="help" href="https://fetch.spec.whatwg.org/#basic-fetch">
|
||||
<meta name="author" title="Canon Research France" href="https://www.crf.canon.fr">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script src="../resources/utils.js"></script>
|
||||
<script src="/common/get-host-info.sub.js"></script>
|
||||
<script src="mode-same-origin.js"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,17 +0,0 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Fetch in worker: same-origin mode</title>
|
||||
<meta name="help" href="https://fetch.spec.whatwg.org/#main-fetch">
|
||||
<meta name="help" href="https://fetch.spec.whatwg.org/#basic-fetch">
|
||||
<meta name="author" title="Canon Research France" href="https://www.crf.canon.fr">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
fetch_tests_from_worker(new Worker("referrer.js"));
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,8 +1,5 @@
|
|||
if (this.document === undefined) {
|
||||
importScripts("/resources/testharness.js");
|
||||
importScripts("../resources/utils.js");
|
||||
importScripts("/common/get-host-info.sub.js")
|
||||
}
|
||||
// META: script=../resources/utils.js
|
||||
// META: script=/common/get-host-info.sub.js
|
||||
|
||||
function runTest(url, init, expectedReferrer, title) {
|
||||
promise_test(function(test) {
|
||||
|
@ -30,6 +27,3 @@ var referrerUrlWithCredentials = get_host_info().HTTP_ORIGIN.replace("http://",
|
|||
runTest(fetchedUrl, {referrer: referrerUrlWithCredentials}, get_host_info().HTTP_ORIGIN + "/", "Referrer with credentials should be stripped");
|
||||
var referrerUrlWithFragmentIdentifier = get_host_info().HTTP_ORIGIN + "#fragmentIdentifier";
|
||||
runTest(fetchedUrl, {referrer: referrerUrlWithFragmentIdentifier}, get_host_info().HTTP_ORIGIN + "/", "Referrer with fragment ID should be stripped");
|
||||
|
||||
done();
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Fetch: same-origin mode</title>
|
||||
<meta name="help" href="https://fetch.spec.whatwg.org/#main-fetch">
|
||||
<meta name="help" href="https://fetch.spec.whatwg.org/#basic-fetch">
|
||||
<meta name="author" title="Canon Research France" href="https://www.crf.canon.fr">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script src="../resources/utils.js"></script>
|
||||
<script src="/common/get-host-info.sub.js"></script>
|
||||
<script src="referrer.js"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,17 +0,0 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Fetch in worker: forbidden request header management</title>
|
||||
<meta name="author" title="Canon Research France" href="https://www.crf.canon.fr">
|
||||
<meta name="help" href="https://fetch.spec.whatwg.org/#forbidden-header-name">
|
||||
<meta name="help" href="https://fetch.spec.whatwg.org/#main-fetch">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
fetch_tests_from_worker(new Worker("request-forbidden-headers.js"));
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,7 +1,4 @@
|
|||
if (this.document === undefined) {
|
||||
importScripts("/resources/testharness.js");
|
||||
importScripts("../resources/utils.js");
|
||||
}
|
||||
// META: script=../resources/utils.js
|
||||
|
||||
function requestForbiddenHeaders(desc, forbiddenHeaders) {
|
||||
var url = RESOURCES_DIR + "inspect-headers.py";
|
||||
|
@ -43,6 +40,3 @@ requestForbiddenHeaders("Proxy- is a forbidden request header", {"Proxy-": "valu
|
|||
requestForbiddenHeaders("Proxy-Test is a forbidden request header", {"Proxy-Test": "value"});
|
||||
requestForbiddenHeaders("Sec- is a forbidden request header", {"Sec-": "value"});
|
||||
requestForbiddenHeaders("Sec-Test is a forbidden request header", {"Sec-Test": "value"});
|
||||
|
||||
done();
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Fetch: forbidden request header management</title>
|
||||
<meta name="author" title="Canon Research France" href="https://www.crf.canon.fr">
|
||||
<meta name="help" href="https://fetch.spec.whatwg.org/#forbidden-header-name">
|
||||
<meta name="help" href="https://fetch.spec.whatwg.org/#main-fetch">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script src="../resources/utils.js"></script>
|
||||
<script src="request-forbidden-headers.js"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,14 +0,0 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Fetch in worker: HEAD method</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
fetch_tests_from_worker(new Worker("request-head.js"));
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,10 +1,4 @@
|
|||
if (this.document === undefined) {
|
||||
importScripts("/resources/testharness.js");
|
||||
}
|
||||
|
||||
promise_test(function(test) {
|
||||
var requestInit = {"method": "HEAD", "body": "test"};
|
||||
return promise_rejects(test, new TypeError(), fetch(".", requestInit));
|
||||
}, "Fetch with HEAD with body");
|
||||
|
||||
done();
|
|
@ -1,12 +0,0 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Fetch: HEAD method</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script src="request-head.js"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,16 +0,0 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Fetch in worker: User agent add headers to request</title>
|
||||
<meta name="author" title="Canon Research France" href="https://www.crf.canon.fr">
|
||||
<meta name="help" href="https://fetch.spec.whatwg.org/#http-network-or-cache-fetch">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
fetch_tests_from_worker(new Worker("request-headers.js"));
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,7 +1,4 @@
|
|||
if (this.document === undefined) {
|
||||
importScripts("/resources/testharness.js");
|
||||
importScripts("../resources/utils.js");
|
||||
}
|
||||
// META: script=../resources/utils.js
|
||||
|
||||
function checkContentType(contentType, body)
|
||||
{
|
||||
|
@ -82,5 +79,3 @@ requestOriginHeader("POST", "no-cors", true);
|
|||
requestOriginHeader("PUT", "same-origin", true);
|
||||
requestOriginHeader("TacO", "same-origin", true);
|
||||
requestOriginHeader("TacO", "cors", true);
|
||||
|
||||
done();
|
|
@ -1,15 +0,0 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Fetch: User agent add headers to request</title>
|
||||
<meta name="author" title="Canon Research France" href="https://www.crf.canon.fr">
|
||||
<meta name="help" href="https://fetch.spec.whatwg.org/#http-network-or-cache-fetch">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script src="../resources/utils.js"></script>
|
||||
<script src="request-headers.js"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,17 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Fetch in worker: referrer header</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
let finalURL = "/fetch/api/basic/request-referrer.any.worker.js";
|
||||
let url = "/fetch/api/resources/redirect.py?location=" +
|
||||
encodeURIComponent(finalURL);
|
||||
fetch_tests_from_worker(new Worker(url));
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,9 +1,6 @@
|
|||
if (this.document === undefined) {
|
||||
importScripts("/resources/testharness.js");
|
||||
importScripts("../resources/utils.js");
|
||||
}
|
||||
// META: script=../resources/utils.js
|
||||
|
||||
function testReferrer(referrer, expected) {
|
||||
function testReferrer(referrer, expected, desc) {
|
||||
promise_test(function(test) {
|
||||
var url = RESOURCES_DIR + "inspect-headers.py?headers=referer"
|
||||
var req = new Request(url, { referrer: referrer });
|
||||
|
@ -17,12 +14,10 @@ function testReferrer(referrer, expected) {
|
|||
assert_equals(actual, "", "request's referer should be empty");
|
||||
}
|
||||
});
|
||||
});
|
||||
}, desc);
|
||||
}
|
||||
|
||||
testReferrer("about:client", window.location.href);
|
||||
testReferrer("about:client", self.location.href, 'about:client referrer');
|
||||
|
||||
var fooURL = new URL("./foo", window.location).href;
|
||||
testReferrer(fooURL, fooURL);
|
||||
|
||||
done();
|
||||
var fooURL = new URL("./foo", self.location).href;
|
||||
testReferrer(fooURL, fooURL, 'url referrer');
|
|
@ -1,13 +0,0 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Fetch: fetch() respects Request referrer value</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script src="../resources/utils.js"></script>
|
||||
<script src="request-referrer.js"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,14 +0,0 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Fetch in worker: Upload</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
fetch_tests_from_worker(new Worker("request-upload.js"));
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,122 @@
|
|||
// META: script=../resources/utils.js
|
||||
|
||||
function testUpload(desc, url, method, createBody, expectedBody) {
|
||||
var requestInit = {"method": method}
|
||||
promise_test(function(test){
|
||||
let body = createBody();
|
||||
if (body)
|
||||
requestInit["body"] = body;
|
||||
return fetch(url, requestInit).then(function(resp) {
|
||||
return resp.text().then((text)=> {
|
||||
assert_equals(text, expectedBody);
|
||||
});
|
||||
});
|
||||
}, desc);
|
||||
}
|
||||
|
||||
function testUploadFailure(desc, url, method, createBody) {
|
||||
const requestInit = {"method": method};
|
||||
promise_test(test => {
|
||||
let body = createBody();
|
||||
if (body)
|
||||
requestInit["body"] = body;
|
||||
return promise_rejects(new TypeError(), fetch(url, requestInit));
|
||||
}, desc);
|
||||
}
|
||||
|
||||
var url = RESOURCES_DIR + "echo-content.py"
|
||||
|
||||
testUpload("Fetch with PUT with body", url,
|
||||
"PUT",
|
||||
() => "Request's body",
|
||||
"Request's body");
|
||||
testUpload("Fetch with POST with text body", url,
|
||||
"POST",
|
||||
() => "Request's body",
|
||||
"Request's body");
|
||||
testUpload("Fetch with POST with URLSearchParams body", url,
|
||||
"POST",
|
||||
() => new URLSearchParams("name=value"),
|
||||
"name=value");
|
||||
testUpload("Fetch with POST with Blob body", url,
|
||||
"POST",
|
||||
() => new Blob(["Test"]),
|
||||
"Test");
|
||||
testUpload("Fetch with POST with ArrayBuffer body", url,
|
||||
"POST",
|
||||
() => new ArrayBuffer(4),
|
||||
"\0\0\0\0");
|
||||
testUpload("Fetch with POST with Uint8Array body", url,
|
||||
"POST",
|
||||
() => new Uint8Array(4),
|
||||
"\0\0\0\0");
|
||||
testUpload("Fetch with POST with Int8Array body", url,
|
||||
"POST",
|
||||
() => new Int8Array(4),
|
||||
"\0\0\0\0");
|
||||
testUpload("Fetch with POST with Float32Array body", url,
|
||||
"POST",
|
||||
() => new Float32Array(1),
|
||||
"\0\0\0\0");
|
||||
testUpload("Fetch with POST with Float64Array body", url,
|
||||
"POST",
|
||||
() => new Float64Array(1),
|
||||
"\0\0\0\0\0\0\0\0");
|
||||
testUpload("Fetch with POST with DataView body", url,
|
||||
"POST",
|
||||
() => new DataView(new ArrayBuffer(8), 0, 4),
|
||||
"\0\0\0\0");
|
||||
testUpload("Fetch with POST with Blob body with mime type", url,
|
||||
"POST",
|
||||
() => new Blob(["Test"], { type: "text/maybe" }),
|
||||
"Test");
|
||||
testUpload("Fetch with POST with ReadableStream", url,
|
||||
"POST",
|
||||
() => {
|
||||
new ReadableStream({start: controller => {
|
||||
const encoder = new TextEncoder();
|
||||
controller.enqueue(encoder.encode("Test"));
|
||||
controller.close();
|
||||
}})
|
||||
},
|
||||
"Test");
|
||||
testUploadFailure("Fetch with POST with ReadableStream containing String", url,
|
||||
"POST",
|
||||
() => {
|
||||
new ReadableStream({start: controller => {
|
||||
controller.enqueue("Test");
|
||||
controller.close();
|
||||
}})
|
||||
});
|
||||
testUploadFailure("Fetch with POST with ReadableStream containing null", url,
|
||||
"POST",
|
||||
() => {
|
||||
new ReadableStream({start: controller => {
|
||||
controller.enqueue(null);
|
||||
controller.close();
|
||||
}})
|
||||
});
|
||||
testUploadFailure("Fetch with POST with ReadableStream containing number", url,
|
||||
"POST",
|
||||
() => {
|
||||
new ReadableStream({start: controller => {
|
||||
controller.enqueue(99);
|
||||
controller.close();
|
||||
}})
|
||||
});
|
||||
testUploadFailure("Fetch with POST with ReadableStream containing ArrayBuffer", url,
|
||||
"POST",
|
||||
() => {
|
||||
new ReadableStream({start: controller => {
|
||||
controller.enqueue(new ArrayBuffer());
|
||||
controller.close();
|
||||
}})
|
||||
});
|
||||
testUploadFailure("Fetch with POST with ReadableStream containing Blob", url,
|
||||
"POST",
|
||||
() => {
|
||||
new ReadableStream({start: controller => {
|
||||
controller.enqueue(new Blob());
|
||||
controller.close();
|
||||
}})
|
||||
});
|
|
@ -1,13 +0,0 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Fetch: Uploading content</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="../resources/utils.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script src="request-upload.js"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,71 +0,0 @@
|
|||
if (this.document === undefined) {
|
||||
importScripts("/resources/testharness.js");
|
||||
importScripts("../resources/utils.js");
|
||||
}
|
||||
|
||||
function testUpload(desc, url, method, body, expectedBody) {
|
||||
var requestInit = {"method": method}
|
||||
promise_test(function(test){
|
||||
if (typeof body === "function")
|
||||
body = body();
|
||||
if (body)
|
||||
requestInit["body"] = body;
|
||||
return fetch(url, requestInit).then(function(resp) {
|
||||
return resp.text().then((text)=> {
|
||||
assert_equals(text, expectedBody);
|
||||
});
|
||||
});
|
||||
}, desc);
|
||||
}
|
||||
|
||||
function testUploadFailure(desc, url, method, body) {
|
||||
const requestInit = {"method": method};
|
||||
promise_test(test => {
|
||||
if (typeof body === "function")
|
||||
body = body();
|
||||
if (body)
|
||||
requestInit["body"] = body;
|
||||
return promise_rejects(new TypeError(), fetch(url, requestInit));
|
||||
}, desc);
|
||||
}
|
||||
|
||||
var url = RESOURCES_DIR + "echo-content.py"
|
||||
|
||||
testUpload("Fetch with PUT with body", url, "PUT", "Request's body", "Request's body");
|
||||
testUpload("Fetch with POST with text body", url, "POST", "Request's body", "Request's body");
|
||||
testUpload("Fetch with POST with URLSearchParams body", url, "POST", function() { return new URLSearchParams("name=value"); }, "name=value");
|
||||
testUpload("Fetch with POST with Blob body", url, "POST", new Blob(["Test"]), "Test");
|
||||
testUpload("Fetch with POST with ArrayBuffer body", url, "POST", new ArrayBuffer(4), "\0\0\0\0");
|
||||
testUpload("Fetch with POST with Uint8Array body", url, "POST", new Uint8Array(4), "\0\0\0\0");
|
||||
testUpload("Fetch with POST with Int8Array body", url, "POST", new Int8Array(4), "\0\0\0\0");
|
||||
testUpload("Fetch with POST with Float32Array body", url, "POST", new Float32Array(1), "\0\0\0\0");
|
||||
testUpload("Fetch with POST with Float64Array body", url, "POST", new Float64Array(1), "\0\0\0\0\0\0\0\0");
|
||||
testUpload("Fetch with POST with DataView body", url, "POST", new DataView(new ArrayBuffer(8), 0, 4), "\0\0\0\0");
|
||||
testUpload("Fetch with POST with Blob body with mime type", url, "POST", new Blob(["Test"], { type: "text/maybe" }), "Test");
|
||||
testUpload("Fetch with POST with ReadableStream", url, "POST", new ReadableStream({start: controller => {
|
||||
const encoder = new TextEncoder();
|
||||
controller.enqueue(encoder.encode("Test"));
|
||||
controller.close();
|
||||
}}), "Test");
|
||||
testUploadFailure("Fetch with POST with ReadableStream containing String", url, "POST", new ReadableStream({start: controller => {
|
||||
controller.enqueue("Test");
|
||||
controller.close();
|
||||
}}));
|
||||
testUploadFailure("Fetch with POST with ReadableStream containing null", url, "POST", new ReadableStream({start: controller => {
|
||||
controller.enqueue(null);
|
||||
controller.close();
|
||||
}}));
|
||||
testUploadFailure("Fetch with POST with ReadableStream containing number", url, "POST", new ReadableStream({start: controller => {
|
||||
controller.enqueue(99);
|
||||
controller.close();
|
||||
}}));
|
||||
testUploadFailure("Fetch with POST with ReadableStream containing ArrayBuffer", url, "POST", new ReadableStream({start: controller => {
|
||||
controller.enqueue(new ArrayBuffer());
|
||||
controller.close();
|
||||
}}));
|
||||
testUploadFailure("Fetch with POST with ReadableStream containing Blob", url, "POST", new ReadableStream({start: controller => {
|
||||
controller.enqueue(new Blob());
|
||||
controller.close();
|
||||
}}));
|
||||
|
||||
done();
|
|
@ -1,17 +0,0 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Fetch in worker: about scheme</title>
|
||||
<meta name="help" href="https://fetch.spec.whatwg.org/#main-fetch">
|
||||
<meta name="help" href="https://fetch.spec.whatwg.org/#basic-fetch">
|
||||
<meta name="author" title="Canon Research France" href="https://www.crf.canon.fr">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
fetch_tests_from_worker(new Worker("scheme-about.js"));
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,7 +1,4 @@
|
|||
if (this.document === undefined) {
|
||||
importScripts("/resources/testharness.js");
|
||||
importScripts("../resources/utils.js");
|
||||
}
|
||||
// META: script=../resources/utils.js
|
||||
|
||||
function checkFetchResponse(url, method, desc) {
|
||||
if (!desc) {
|
||||
|
@ -35,5 +32,3 @@ function checkKoUrl(url, desc) {
|
|||
checkKoUrl("about:invalid.com");
|
||||
checkKoUrl("about:config");
|
||||
checkKoUrl("about:unicorn");
|
||||
|
||||
done();
|
|
@ -1,16 +0,0 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Fetch: about scheme</title>
|
||||
<meta name="help" href="https://fetch.spec.whatwg.org/#main-fetch">
|
||||
<meta name="help" href="https://fetch.spec.whatwg.org/#basic-fetch">
|
||||
<meta name="author" title="Canon Research France" href="https://www.crf.canon.fr">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script src="../resources/utils.js"></script>
|
||||
<script src="scheme-about.js"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,17 +0,0 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Fetch in worker: data scheme</title>
|
||||
<meta name="help" href="https://fetch.spec.whatwg.org/#main-fetch">
|
||||
<meta name="help" href="https://fetch.spec.whatwg.org/#basic-fetch">
|
||||
<meta name="author" title="Canon Research France" href="https://www.crf.canon.fr">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
fetch_tests_from_worker(new Worker("scheme-data.js"));
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,7 +1,4 @@
|
|||
if (this.document === undefined) {
|
||||
importScripts("/resources/testharness.js");
|
||||
importScripts("../resources/utils.js");
|
||||
}
|
||||
// META: script=../resources/utils.js
|
||||
|
||||
function checkFetchResponse(url, data, mime, fetchMode, method) {
|
||||
var cut = (url.length >= 40) ? "[...]" : "";
|
||||
|
@ -43,5 +40,3 @@ function checkKoUrl(url, method, desc) {
|
|||
}
|
||||
|
||||
checkKoUrl("data:notAdataUrl.com", "GET");
|
||||
|
||||
done();
|
|
@ -1,16 +0,0 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Fetch: data scheme</title>
|
||||
<meta name="help" href="https://fetch.spec.whatwg.org/#main-fetch">
|
||||
<meta name="help" href="https://fetch.spec.whatwg.org/#basic-fetch">
|
||||
<meta name="author" title="Canon Research France" href="https://www.crf.canon.fr">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script src="../resources/utils.js"></script>
|
||||
<script src="scheme-data.js"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,17 +0,0 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Fetch in worker: retrieve response's body progressively</title>
|
||||
<meta name="help" href="https://fetch.spec.whatwg.org/#main-fetch">
|
||||
<meta name="help" href="https://fetch.spec.whatwg.org/#http-fetch">
|
||||
<meta name="author" title="Canon Research France" href="https://www.crf.canon.fr">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
fetch_tests_from_worker(new Worker("stream-response.js"));
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,7 +1,4 @@
|
|||
if (this.document === undefined) {
|
||||
importScripts("/resources/testharness.js");
|
||||
importScripts("../resources/utils.js");
|
||||
}
|
||||
// META: script=../resources/utils.js
|
||||
|
||||
function streamBody(reader, test, count) {
|
||||
return reader.read().then(function(data) {
|
||||
|
@ -29,5 +26,3 @@ promise_test(function(test) {
|
|||
});
|
||||
});
|
||||
}, "Stream response's body");
|
||||
|
||||
done();
|
|
@ -1,16 +0,0 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Fetch: retrieve response's body progressively</title>
|
||||
<meta name="help" href="https://fetch.spec.whatwg.org/#main-fetch">
|
||||
<meta name="help" href="https://fetch.spec.whatwg.org/#http-fetch">
|
||||
<meta name="author" title="Canon Research France" href="https://www.crf.canon.fr">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script src="../resources/utils.js"></script>
|
||||
<script src="stream-response.js"></script>
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue