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