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

Side by Side 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 unified diff | Download patch
OLDNEW
1 if (self.importScripts) { 1 if (self.importScripts) {
2 importScripts('../resources/fetch-test-helpers.js'); 2 importScripts('../resources/fetch-test-helpers.js');
3 } 3 }
4 4
5 promise_test(function(t) { 5 promise_test(function(t) {
6 return fetch('http://') 6 return fetch('http://')
7 .then( 7 .then(
8 t.unreached_func('fetch of invalid URL must fail'), 8 t.unreached_func('fetch of invalid URL must fail'),
9 function() {}); 9 function() {});
10 }, 'Fetch invalid URL'); 10 }, 'Fetch invalid URL');
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 test(function(t) { 286 test(function(t) {
287 function runInfiniteFetchLoop() { 287 function runInfiniteFetchLoop() {
288 fetch('dummy.html') 288 fetch('dummy.html')
289 .then(function() { runInfiniteFetchLoop(); }); 289 .then(function() { runInfiniteFetchLoop(); });
290 } 290 }
291 runInfiniteFetchLoop(); 291 runInfiniteFetchLoop();
292 }, 292 },
293 'Destroying the execution context while fetch is happening should not ' + 293 'Destroying the execution context while fetch is happening should not ' +
294 'cause a crash.'); 294 'cause a crash.');
295 295
296 test(t => {
297 var req = new Request('/', {method: 'POST', body: ''});
298 fetch(req);
299 assert_true(req.bodyUsed);
300 }, 'Calling fetch() disturbs body if not null');
301
302 test(t => {
303 var req = new Request('/', {method: 'POST'});
304 fetch(req);
305 assert_false(req.bodyUsed);
306 }, 'Calling fetch() doesn\'t disturb body if null');
307
296 done(); 308 done();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698