| OLD | NEW |
| 1 <?php | 1 <?php |
| 2 // Force the browser to cache this script. update() should always bypass this | 2 // update() does not bypass cache so set the max-age to 0 such that update() |
| 3 // cache and fetch a new version. | 3 // can find a new version in the network. |
| 4 header('Cache-Control: max-age=86400'); | 4 header('Cache-Control: max-age=0'); |
| 5 | 5 |
| 6 // Return a different script for each access. | 6 // Return a different script for each access. |
| 7 header('Content-Type:application/javascript'); | 7 header('Content-Type:application/javascript'); |
| 8 echo '// ' . microtime(); | 8 echo '// ' . microtime(); |
| 9 ?> | 9 ?> |
| 10 | 10 |
| 11 importScripts('../../resources/test-helpers.js'); | 11 importScripts('../../resources/test-helpers.js'); |
| 12 importScripts('../../resources/worker-testharness.js'); | 12 importScripts('../../resources/worker-testharness.js'); |
| 13 | 13 |
| 14 var events_seen = []; | 14 var events_seen = []; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 26 e.respondWith(new Response(events_seen)); | 26 e.respondWith(new Response(events_seen)); |
| 27 }); | 27 }); |
| 28 | 28 |
| 29 self.addEventListener('message', function(e) { | 29 self.addEventListener('message', function(e) { |
| 30 events_seen.push('message'); | 30 events_seen.push('message'); |
| 31 self.registration.update(); | 31 self.registration.update(); |
| 32 }); | 32 }); |
| 33 | 33 |
| 34 // update() during the script evaluation should be ignored. | 34 // update() during the script evaluation should be ignored. |
| 35 self.registration.update(); | 35 self.registration.update(); |
| OLD | NEW |