OLD | NEW |
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 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 test(function(t) { | 349 test(function(t) { |
350 function runInfiniteFetchLoop() { | 350 function runInfiniteFetchLoop() { |
351 fetch('dummy.html') | 351 fetch('dummy.html') |
352 .then(function() { runInfiniteFetchLoop(); }); | 352 .then(function() { runInfiniteFetchLoop(); }); |
353 } | 353 } |
354 runInfiniteFetchLoop(); | 354 runInfiniteFetchLoop(); |
355 }, | 355 }, |
356 'Destroying the execution context while fetch is happening should not ' + | 356 'Destroying the execution context while fetch is happening should not ' + |
357 'cause a crash.'); | 357 'cause a crash.'); |
358 | 358 |
| 359 test(t => { |
| 360 var req = new Request('/', {method: 'POST', body: ''}); |
| 361 fetch(req); |
| 362 assert_true(req.bodyUsed); |
| 363 }, 'Calling fetch() disturbs body if not null'); |
| 364 |
| 365 test(t => { |
| 366 var req = new Request('/', {method: 'POST'}); |
| 367 fetch(req); |
| 368 assert_false(req.bodyUsed); |
| 369 }, 'Calling fetch() doesn\'t disturb body if null'); |
| 370 |
359 done(); | 371 done(); |
OLD | NEW |