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

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

Issue 1418813004: [Fetch API] Reflect spec changes of bodyUsed property (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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: third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/response-content.js
diff --git a/third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/response-content.js b/third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/response-content.js
index 25321cf8912fadadb28be6804321f4c25add6679..e8cdcac37a13ced682e21da2191268a2eb730ffe 100644
--- a/third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/response-content.js
+++ b/third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/response-content.js
@@ -124,7 +124,6 @@ promise_test(function() {
assert_false(response.bodyUsed, 'bodyUsed is not set by clone().');
assert_false(response2.bodyUsed, 'bodyUsed is not set by clone().');
response.headers.set('Content-Language', 'en');
- var response3;
assert_equals(
response2.headers.get('Content-Language'), 'ja', 'Headers of cloned ' +
'response should not change when original response headers are changed.');
@@ -137,20 +136,13 @@ promise_test(function() {
function() { response3 = response.clone(); },
'Response.clone() should throw if the body was used.');
return p.then(function(text) {
- assert_false(response.bodyUsed,
- 'bodyUsed becomes false when text() is done.');
+ assert_true(response.bodyUsed);
assert_false(response2.bodyUsed);
- response3 = response.clone();
return response2.text();
}).then(function(text) {
assert_equals(text, 'test string',
'Response clone response body text should match.');
- return Promise.all([response.text(), response2.text(),
- response3.text()]);
- }).then(function(texts) {
- assert_equals(texts[0], '', 'Cloned after consumed.');
- assert_equals(texts[1], '', 'Already consumed.');
- assert_equals(texts[2], '', 'Cloned after consumed.');
+ assert_true(response2.bodyUsed);
});
}, 'Behavior of bodyUsed in Response and clone behavior.');

Powered by Google App Engine
This is Rietveld 408576698