mirror of
https://github.com/servo/servo.git
synced 2025-08-09 23:45:35 +01:00
Update web-platform-tests to revision 82cecba576456d05c09894749379df1013ab488f
This commit is contained in:
parent
de9c84f686
commit
60b62482da
145 changed files with 2705 additions and 367 deletions
|
@ -2,50 +2,50 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
async function assert_request(input, init) {
|
||||
async function assert_request(test, input, init) {
|
||||
assert_throws(new TypeError(), () => new Request(input, init), "new Request()");
|
||||
assert_throws(new TypeError(), async () => await fetch(input, init), "fetch()");
|
||||
await promise_rejects_js(test, TypeError, fetch(input, init), "fetch()");
|
||||
}
|
||||
|
||||
promise_test(async () => {
|
||||
promise_test(async (t) => {
|
||||
const stream = new ReadableStream();
|
||||
stream.getReader();
|
||||
await assert_request("...", { method:"POST", body: stream });
|
||||
await assert_request(t, "...", { method:"POST", body: stream });
|
||||
}, "Constructing a Request with a stream on which getReader() is called");
|
||||
|
||||
promise_test(async () => {
|
||||
promise_test(async (t) => {
|
||||
const stream = new ReadableStream();
|
||||
stream.getReader().read();
|
||||
await assert_request("...", { method:"POST", body: stream });
|
||||
await assert_request(t, "...", { method:"POST", body: stream });
|
||||
}, "Constructing a Request with a stream on which read() is called");
|
||||
|
||||
promise_test(async () => {
|
||||
promise_test(async (t) => {
|
||||
const stream = new ReadableStream({ pull: c => c.enqueue(new Uint8Array()) }),
|
||||
reader = stream.getReader();
|
||||
await reader.read();
|
||||
reader.releaseLock();
|
||||
await assert_request("...", { method:"POST", body: stream });
|
||||
await assert_request(t, "...", { method:"POST", body: stream });
|
||||
}, "Constructing a Request with a stream on which read() and releaseLock() are called");
|
||||
|
||||
promise_test(async () => {
|
||||
promise_test(async (t) => {
|
||||
const request = new Request("...", { method: "POST", body: "..." });
|
||||
request.body.getReader();
|
||||
await assert_request(request);
|
||||
await assert_request(t, request);
|
||||
assert_class_string(new Request(request, { body: "..." }), "Request");
|
||||
}, "Constructing a Request with a Request on which body.getReader() is called");
|
||||
|
||||
promise_test(async () => {
|
||||
promise_test(async (t) => {
|
||||
const request = new Request("...", { method: "POST", body: "..." });
|
||||
request.body.getReader().read();
|
||||
await assert_request(request);
|
||||
await assert_request(t, request);
|
||||
assert_class_string(new Request(request, { body: "..." }), "Request");
|
||||
}, "Constructing a Request with a Request on which body.getReader().read() is called");
|
||||
|
||||
promise_test(async () => {
|
||||
promise_test(async (t) => {
|
||||
const request = new Request("...", { method: "POST", body: "..." }),
|
||||
reader = request.body.getReader();
|
||||
await reader.read();
|
||||
reader.releaseLock();
|
||||
await assert_request(request);
|
||||
await assert_request(t, request);
|
||||
assert_class_string(new Request(request, { body: "..." }), "Request");
|
||||
}, "Constructing a Request with a Request on which read() and releaseLock() are called");
|
||||
|
|
|
@ -20,6 +20,16 @@
|
|||
|
||||
assert_true(responseError.headers.entries().next().done, "Headers should be empty");
|
||||
}, "Check response returned by static method error()");
|
||||
|
||||
test(function() {
|
||||
const headers = Response.error().headers;
|
||||
|
||||
// Avoid false positives if expected API is not available
|
||||
assert_true(!!headers);
|
||||
assert_equals(typeof headers.append, 'function');
|
||||
|
||||
assert_throws_js(TypeError, function () { headers.append('name', 'value'); });
|
||||
}, "the 'guard' of the Headers instance should be immutable");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue