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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/response.js

Issue 2671213003: BodyStreamBuffer should take care the case where endRead returns Done (Closed)
Patch Set: fix Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/fetch/BodyStreamBuffer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/response.js
diff --git a/third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/response.js b/third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/response.js
index b0d9c4022f0b8eb18c3a587b087b21aeea0de83c..d0c4b07ac1a85df0d485de2d085103ff19943a91 100644
--- a/third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/response.js
+++ b/third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/response.js
@@ -490,6 +490,19 @@ promise_test(() => {
}, 'Response constructed with a stream');
promise_test(() => {
+ var response = new Response('helloworld');
+ return readableStreamToArray(response.body).then(chunks => {
+ const decoder = new TextDecoder('utf-8');
+ let r = '';
+ for (const chunk of chunks) {
+ r += decoder.decode(chunk, {stream: true});
+ }
+ r += decoder.decode();
+ assert_equals(r, 'helloworld');
+ });
+ }, 'Response constructed with a String / Read from body stream');
+
+promise_test(() => {
var controller;
var stream = new ReadableStream({start: c => controller = c});
controller.enqueue(new Uint8Array([0x68, 0x65, 0x6c, 0x6c, 0x6f]));
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/fetch/BodyStreamBuffer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698