1 self.onmessage = function(e) {
3 if ('port' in message) {
12 'http://www.example.com/foo',
13 'fetch-status.php?status=200',
14 'fetch-status.php?status=404'
17 function doNextFetchTest(port) {
18 if (testTargets.length == 0) {
19 port.postMessage('quit');
20 // Destroying the execution context while fetch is happening should not cause a crash.
21 fetch('dummy.html').then(function() {}).catch(function() {});
25 var target = testTargets.shift();
27 .then(function(response) {
28 port.postMessage('Resolved: ' + target + ' [' + response.status + ']' + response.statusText);
29 doNextFetchTest(port);
30 }).catch(function(e) {
31 port.postMessage('Rejected: ' + target + ' : '+ e.message);
32 doNextFetchTest(port);