Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(745)

Side by Side Diff: third_party/WebKit/LayoutTests/external/wpt/fetch/api/response/response-stream-disturbed-3.html

Issue 2778753002: Import //fetch from Web Platform Tests. (Closed)
Patch Set: Baselines. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 <!doctype html>
2 <html>
3 <head>
4 <meta charset="utf-8">
5 <title>Consuming Response body after getting a ReadableStream</title>
6 <meta name="help" href="https://fetch.spec.whatwg.org/#response">
7 <meta name="help" href="https://fetch.spec.whatwg.org/#body-mixin">
8 <meta name="author" title="Canon Research France" href="https://www.crf.cano n.fr">
9 <script src="/resources/testharness.js"></script>
10 <script src="/resources/testharnessreport.js"></script>
11 </head>
12 <body>
13 <script>
14
15 function createResponseWithDisturbedReadableStream(callback) {
16 return fetch("../resources/data.json").then(function(response) {
17 var reader = response.body.getReader();
18 reader.read();
19 return callback(response);
20 });
21 }
22
23 promise_test(function(test) {
24 return createResponseWithDisturbedReadableStream(function(response) {
25 return promise_rejects(test, new TypeError(), response.blob());
26 });
27 }, "Getting blob after reading the Response body");
28
29 promise_test(function(test) {
30 return createResponseWithDisturbedReadableStream(function(response) {
31 return promise_rejects(test, new TypeError(), response.text());
32 });
33 }, "Getting text after reading the Response body");
34
35 promise_test(function(test) {
36 return createResponseWithDisturbedReadableStream(function(response) {
37 return promise_rejects(test, new TypeError(), response.json());
38 });
39 }, "Getting json after reading the Response body");
40
41 promise_test(function(test) {
42 return createResponseWithDisturbedReadableStream(function(response) {
43 return promise_rejects(test, new TypeError(), response.arrayBuffer());
44 });
45 }, "Getting arrayBuffer after reading the Response body");
46
47 </script>
48 </body>
49 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698