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

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, 2 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: 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 60974662b01e9fcf195a5b93bcbff316afe1fe4c..ef23ad7c39dd0bcf54b6e37f9834d6926dac6af6 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
@@ -293,4 +293,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