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

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

Powered by Google App Engine
This is Rietveld 408576698