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

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

Issue 1056783002: [Fetch] Request constructor should reflect body consumption. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@body-used
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
« no previous file with comments | « no previous file | Source/modules/fetch/Request.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 7e16329c30e3999b4f9d8d6f590641ff4e42c23e..59104148857c242792d6d912463fcf83770e2133 100644
--- a/LayoutTests/http/tests/fetch/script-tests/request.js
+++ b/LayoutTests/http/tests/fetch/script-tests/request.js
@@ -705,4 +705,17 @@ promise_test(function(t) {
});
}, 'Extract a MIME type (1)');
+promise_test(function(t) {
+ var req = new Request('http://localhost/', {method: 'POST', body: 'hello'});
+ return req.text().then(function(text) {
+ assert_equals(text, 'hello');
+ var req2 = new Request(req);
+ assert_true(req.bodyUsed);
+ assert_false(req2.bodyUsed);
+ return req2.text();
+ }).then(function(text) {
+ assert_equals(text, '');
+ });
+ }, 'Consume and pass');
+
done();
« no previous file with comments | « no previous file | Source/modules/fetch/Request.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698