| 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 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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(); |
| OLD | NEW |