Update web-platform-tests to revision b'79fa4cf76e0d39e3fc1b7ead85e067b0a064b892'

This commit is contained in:
WPT Sync Bot 2021-03-06 08:21:21 +00:00
parent 4a46a476d7
commit 31f9c69336
83 changed files with 2200 additions and 954 deletions

View file

@ -1,5 +1,7 @@
// META: global=window,worker
// META: script=../resources/utils.js
// META: script=/common/utils.js
// META: script=/common/get-host-info.sub.js
function testUpload(desc, url, method, createBody, expectedBody) {
const requestInit = {"method": method}
@ -123,3 +125,30 @@ testUploadFailure("Fetch with POST with ReadableStream containing Blob", url,
controller.close();
}})
});
promise_test(async (test) => {
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: "foobar"});
assert_equals(resp.status, 421);
const text = await resp.text();
assert_equals(text, "ok. Request was sent 2 times. 2 connections were created.");
}, "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.");