| OLD | NEW |
| 1 self.onmessage = function(e) { | 1 self.onmessage = function(e) { |
| 2 var message = e.data; | 2 var message = e.data; |
| 3 if ('port' in message) { | 3 if ('port' in message) { |
| 4 port = message.port; | 4 port = message.port; |
| 5 doTextTest(port); | 5 doTextTest(port); |
| 6 } | 6 } |
| 7 }; | 7 }; |
| 8 | 8 |
| 9 function quit(port) { | 9 function quit(port) { |
| 10 port.postMessage('quit'); | 10 port.postMessage('quit'); |
| 11 self.close(); |
| 11 } | 12 } |
| 12 | 13 |
| 13 function doFetchTwiceTest(port) { | 14 function doFetchTwiceTest(port) { |
| 14 var p1Out = p2Out = null; | 15 var p1Out = p2Out = null; |
| 15 | 16 |
| 16 fetch('doctype.html') | 17 fetch('doctype.html') |
| 17 .then(function(response) { | 18 .then(function(response) { |
| 18 var p1 = response.body.asText(); | 19 var p1 = response.body.asText(); |
| 19 var p2 = response.body.asText(); | 20 var p2 = response.body.asText(); |
| 20 | 21 |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 | 85 |
| 85 function doTextTest(port) { | 86 function doTextTest(port) { |
| 86 fetch('doctype.html') | 87 fetch('doctype.html') |
| 87 .then(function(response) { | 88 .then(function(response) { |
| 88 response.body.asText() | 89 response.body.asText() |
| 89 .then(function(txt) { | 90 .then(function(txt) { |
| 90 port.postMessage('Text: ' + txt); | 91 port.postMessage('Text: ' + txt); |
| 91 doJSONTest(port); | 92 doJSONTest(port); |
| 92 }); | 93 }); |
| 93 }); | 94 }); |
| 94 } | 95 } |
| OLD | NEW |