mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Update web-platform-tests to revision b'468d01bbd84da2babf265c6af46947be68713440'
This commit is contained in:
parent
35e95f55a1
commit
58e8ee674b
9438 changed files with 266112 additions and 106976 deletions
|
@ -1,7 +1,7 @@
|
|||
// META: global=window,worker
|
||||
// META: script=../resources/utils.js
|
||||
|
||||
function streamBody(reader, test, count) {
|
||||
function streamBody(reader, test, count = 0) {
|
||||
return reader.read().then(function(data) {
|
||||
if (!data.done && count < 2) {
|
||||
count += 1;
|
||||
|
@ -18,12 +18,23 @@ function streamBody(reader, test, count) {
|
|||
//count is large enough to let the UA deliver the body before it is completely retrieved
|
||||
promise_test(function(test) {
|
||||
return fetch(RESOURCES_DIR + "trickle.py?ms=30&count=100").then(function(resp) {
|
||||
var count = 0;
|
||||
if (resp.body)
|
||||
return streamBody(resp.body.getReader(), test, count);
|
||||
return streamBody(resp.body.getReader(), test);
|
||||
else
|
||||
test.step(function() {
|
||||
assert_unreached( "Body does not exist in response");
|
||||
});
|
||||
});
|
||||
}, "Stream response's body");
|
||||
}, "Stream response's body when content-type is present");
|
||||
|
||||
// This test makes sure that the response body is not buffered if no content type is provided.
|
||||
promise_test(function(test) {
|
||||
return fetch(RESOURCES_DIR + "trickle.py?ms=300&count=10¬ype=true").then(function(resp) {
|
||||
if (resp.body)
|
||||
return streamBody(resp.body.getReader(), test);
|
||||
else
|
||||
test.step(function() {
|
||||
assert_unreached( "Body does not exist in response");
|
||||
});
|
||||
});
|
||||
}, "Stream response's body when content-type is not present");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue