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

Side by Side Diff: third_party/WebKit/LayoutTests/external/wpt/fetch/api/response/response-stream-disturbed-5.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 promise_test(function() {
16 return fetch("../resources/data.json").then(function(response) {
17 response.blob();
18 assert_not_equals(response.body, null);
19 assert_throws(new TypeError(), function() { response.body.getReader(); } );
20 });
21 }, "Getting a body reader after consuming as blob");
22
23 promise_test(function() {
24 return fetch("../resources/data.json").then(function(response) {
25 response.text();
26 assert_not_equals(response.body, null);
27 assert_throws(new TypeError(), function() { response.body.getReader(); } );
28 });
29 }, "Getting a body reader after consuming as text");
30
31 promise_test(function() {
32 return fetch("../resources/data.json").then(function(response) {
33 response.json();
34 assert_not_equals(response.body, null);
35 assert_throws(new TypeError(), function() { response.body.getReader(); } );
36 });
37 }, "Getting a body reader after consuming as json");
38
39 promise_test(function() {
40 return fetch("../resources/data.json").then(function(response) {
41 response.arrayBuffer();
42 assert_not_equals(response.body, null);
43 assert_throws(new TypeError(), function() { response.body.getReader(); } );
44 });
45 }, "Getting a body reader after consuming as arrayBuffer");
46
47 </script>
48 </body>
49 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698