Update web-platform-tests to revision f8941337b646b67942d912db9ce83cd612d2bd60

This commit is contained in:
WPT Sync Bot 2020-10-30 08:20:24 +00:00
parent b15995fcab
commit 6a818ffecf
431 changed files with 14440 additions and 5715 deletions

View file

@ -0,0 +1,42 @@
// META: global=window,worker
// META: title=Consuming Response body after getting a ReadableStream
function createResponseWithReadableStream(callback) {
return fetch("../resources/data.json").then(function(response) {
var reader = response.body.getReader();
reader.releaseLock();
return callback(response);
});
}
promise_test(function() {
return createResponseWithReadableStream(function(response) {
return response.blob().then(function(blob) {
assert_true(blob instanceof Blob);
});
});
}, "Getting blob after getting the Response body - not disturbed, not locked");
promise_test(function() {
return createResponseWithReadableStream(function(response) {
return response.text().then(function(text) {
assert_true(text.length > 0);
});
});
}, "Getting text after getting the Response body - not disturbed, not locked");
promise_test(function() {
return createResponseWithReadableStream(function(response) {
return response.json().then(function(json) {
assert_equals(typeof json, "object");
});
});
}, "Getting json after getting the Response body - not disturbed, not locked");
promise_test(function() {
return createResponseWithReadableStream(function(response) {
return response.arrayBuffer().then(function(arrayBuffer) {
assert_true(arrayBuffer.byteLength > 0);
});
});
}, "Getting arrayBuffer after getting the Response body - not disturbed, not locked");