mirror of
https://github.com/servo/servo.git
synced 2025-08-15 02:15:33 +01:00
Update web-platform-tests to revision fab2c513bffb2bd19600d23b495264d123df092f
This commit is contained in:
parent
c226bf85a9
commit
ebddcc2d7f
441 changed files with 3689 additions and 1521 deletions
|
@ -0,0 +1,66 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Response consume blob and http bodies</title>
|
||||
<meta name="help" href="https://fetch.spec.whatwg.org/#response">
|
||||
<meta name="help" href="https://fetch.spec.whatwg.org/#body-mixin">
|
||||
<meta name="author" title="Canon Research France" href="https://www.crf.canon.fr">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script src="../resources/utils.js"></script>
|
||||
<script>
|
||||
|
||||
promise_test(function(test) {
|
||||
return new Response(new Blob([], { "type" : "text/plain" })).body.cancel();
|
||||
}, "Cancelling a starting blob Response stream");
|
||||
|
||||
promise_test(function(test) {
|
||||
var response = new Response(new Blob(["This is data"], { "type" : "text/plain" }));
|
||||
var reader = response.body.getReader();
|
||||
reader.read();
|
||||
return reader.cancel();
|
||||
}, "Cancelling a loading blob Response stream");
|
||||
|
||||
promise_test(function(test) {
|
||||
var response = new Response(new Blob(["T"], { "type" : "text/plain" }));
|
||||
var reader = response.body.getReader();
|
||||
|
||||
var closedPromise = reader.closed.then(function() {
|
||||
return reader.cancel();
|
||||
});
|
||||
reader.read();
|
||||
return closedPromise;
|
||||
}, "Cancelling a closed blob Response stream");
|
||||
|
||||
promise_test(function(test) {
|
||||
return fetch(RESOURCES_DIR + "trickle.py?ms=30&count=100").then(function(response) {
|
||||
return response.body.cancel();
|
||||
});
|
||||
}, "Cancelling a starting Response stream");
|
||||
|
||||
promise_test(function() {
|
||||
return fetch(RESOURCES_DIR + "trickle.py?ms=30&count=100").then(function(response) {
|
||||
var reader = response.body.getReader();
|
||||
return reader.read().then(function() {
|
||||
return reader.cancel();
|
||||
});
|
||||
});
|
||||
}, "Cancelling a loading Response stream");
|
||||
|
||||
promise_test(function() {
|
||||
return fetch(RESOURCES_DIR + "top.txt").then(function(response) {
|
||||
var reader = response.body.getReader();
|
||||
var closedPromise = reader.closed.then(function() {
|
||||
return reader.cancel();
|
||||
});
|
||||
reader.read();
|
||||
return closedPromise;
|
||||
});
|
||||
}, "Cancelling a closed Response stream");
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue