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

Unified Diff: LayoutTests/http/tests/fetch/script-tests/request.js

Issue 1049983003: [Fetch] Body consume function should not set bodyUsed flag. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@stream-clone
Patch Set: Created 5 years, 9 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
Index: LayoutTests/http/tests/fetch/script-tests/request.js
diff --git a/LayoutTests/http/tests/fetch/script-tests/request.js b/LayoutTests/http/tests/fetch/script-tests/request.js
index 1a913871797d3c227f9bc910ce419bbdc4b74a36..7e16329c30e3999b4f9d8d6f590641ff4e42c23e 100644
--- a/LayoutTests/http/tests/fetch/script-tests/request.js
+++ b/LayoutTests/http/tests/fetch/script-tests/request.js
@@ -473,14 +473,16 @@ promise_test(function() {
'Headers of cloned request should not change when ' +
'original request headers are changed.');
- return req.text()
- .then(function(text) {
- assert_equals(text, 'Test Blob', 'Body of request should match.');
- return req2.text();
- })
- .then(function(text) {
- assert_equals(text, 'Test Blob', 'Cloned request body should match.');
- });
+ return req.text().then(function(text) {
+ assert_equals(text, 'Test Blob', 'Body of request should match.');
+ return req2.text();
+ }).then(function(text) {
+ assert_equals(text, 'Test Blob', 'Cloned request body should match.');
+ return Promise.all([req.text(), req2.text()]);
+ }).then(function(texts) {
+ assert_equals(texts[0], '', 'The body is consumed.');
+ assert_equals(texts[1], '', 'The body is consumed.');
+ });
}, 'Test clone behavior with loading content from Request.');
async_test(function(t) {
« no previous file with comments | « LayoutTests/http/tests/cachestorage/script-tests/cache-put.js ('k') | LayoutTests/http/tests/fetch/script-tests/response.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698