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

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

Issue 1205053002: Merge 197325 "[Fetch] Check / Set .bodyUsed in Request construct..." (Closed) Base URL: svn://svn.chromium.org/blink/branches/chromium/2403/
Patch Set: Created 5 years, 6 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
===================================================================
--- LayoutTests/http/tests/fetch/script-tests/request.js (revision 197738)
+++ LayoutTests/http/tests/fetch/script-tests/request.js (working copy)
@@ -272,9 +272,10 @@
assert_false(req.bodyUsed,
'Request should not be flagged as used if it has not been ' +
'consumed.');
+ // See https://crbug.com/501195.
var req2 = new Request(req);
- assert_false(req.bodyUsed,
- 'Request should not be flagged as used if it does not have' +
+ assert_true(req.bodyUsed,
+ 'Request should be flagged as used if it does not have' +
'body.');
assert_false(req2.bodyUsed,
'Request should not be flagged as used if it has not been ' +
@@ -292,11 +293,11 @@
assert_false(req2.bodyUsed,
'Request should not be flagged as used if it has not been ' +
'consumed.');
- // Now we can create a Request from |req|, because creating |req2| from
- // |req| sets |req|'s body to null as specified.
- var req3 = new Request(req);
- assert_true(req.bodyUsed,
- 'Request should be flagged as used if it has been consumed.');
+ // See https://crbug.com/501195.
+ assert_throws(
+ {name: 'TypeError'},
+ function() { new Request(req); },
+ 'Request construction should throw if used.');
}, 'Request construction without body behavior regardning "bodyUsed"');
test(function() {
« 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