mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Update web-platform-tests to revision b'b728032f59a396243864b0f8584e7211e3632005'
This commit is contained in:
parent
ace9b32b1c
commit
df68c4e5d1
15632 changed files with 514865 additions and 155000 deletions
|
@ -9,6 +9,7 @@ function testUpload(desc, url, method, createBody, expectedBody) {
|
|||
const body = createBody();
|
||||
if (body) {
|
||||
requestInit["body"] = body;
|
||||
requestInit.duplex = "half";
|
||||
}
|
||||
return fetch(url, requestInit).then(function(resp) {
|
||||
return resp.text().then((text)=> {
|
||||
|
@ -129,44 +130,6 @@ promise_test(async (test) => {
|
|||
}, "Fetch with POST with text body on 421 response should be retried once on new connection.");
|
||||
|
||||
promise_test(async (test) => {
|
||||
const body = new ReadableStream({start: controller => {
|
||||
const encoder = new TextEncoder();
|
||||
controller.enqueue(encoder.encode("Test"));
|
||||
controller.close();
|
||||
}});
|
||||
const resp = await fetch(
|
||||
"/fetch/connection-pool/resources/network-partition-key.py?"
|
||||
+ `status=421&uuid=${token()}&partition_id=${get_host_info().ORIGIN}`
|
||||
+ `&dispatch=check_partition&addcounter=true`,
|
||||
{method: "POST", body: body});
|
||||
assert_equals(resp.status, 421);
|
||||
const text = await resp.text();
|
||||
assert_equals(text, "ok. Request was sent 1 times. 1 connections were created.");
|
||||
}, "Fetch with POST with ReadableStream on 421 response should return the response and not retry.");
|
||||
|
||||
promise_test(async (test) => {
|
||||
const request = new Request('', {
|
||||
body: new ReadableStream(),
|
||||
method: 'POST',
|
||||
});
|
||||
|
||||
assert_equals(request.headers.get('Content-Type'), null, `Request should not have a content-type set`);
|
||||
|
||||
const response = await fetch('data:a/a;charset=utf-8,test', {
|
||||
method: 'POST',
|
||||
body: new ReadableStream(),
|
||||
});
|
||||
|
||||
assert_equals(await response.text(), 'test', `Response has correct body`);
|
||||
}, "Feature detect for POST with ReadableStream");
|
||||
|
||||
promise_test(async (test) => {
|
||||
const request = new Request('data:a/a;charset=utf-8,test', {
|
||||
body: new ReadableStream(),
|
||||
method: 'POST',
|
||||
});
|
||||
|
||||
assert_equals(request.headers.get('Content-Type'), null, `Request should not have a content-type set`);
|
||||
const response = await fetch(request);
|
||||
assert_equals(await response.text(), 'test', `Response has correct body`);
|
||||
}, "Feature detect for POST with ReadableStream, using request object");
|
||||
const body = new ReadableStream({start: c => c.close()});
|
||||
await promise_rejects_js(test, TypeError, fetch('/', {method: 'POST', body}));
|
||||
}, "Streaming upload shouldn't work on Http/1.1.");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue