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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/fetch.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/fetch.js
diff --git a/third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/fetch.js b/third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/fetch.js
index eb97820cd9333628a1d78bba5ec7ea18c694151b..d2d188c6acc72789ad215df24bf776f2f9ecc66a 100644
--- a/third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/fetch.js
+++ b/third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/fetch.js
@@ -356,4 +356,16 @@ test(function(t) {
'Destroying the execution context while fetch is happening should not ' +
'cause a crash.');
+test(t => {
+ var req = new Request('/', {method: 'POST', body: ''});
+ fetch(req);
+ assert_true(req.bodyUsed);
+}, 'Calling fetch() disturbs body if not null');
+
+test(t => {
+ var req = new Request('/', {method: 'POST'});
+ fetch(req);
+ assert_false(req.bodyUsed);
+}, 'Calling fetch() doesn\'t disturb body if null');
+
done();

Powered by Google App Engine
This is Rietveld 408576698