Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
| 2 <script> | |
| 3 // See ServiceWorkerBrowserTest ImportsBustMemcache. | |
| 4 // Content-shell data persists, so unreg first to clear old data. | |
| 5 // Register, unregister, then reregister, the browsertest .cc code examines | |
| 6 // the state of the scriptcache to ensure the script and import are cached. | |
|
michaeln
2014/08/08 19:46:03
ooops... my edits to this file didn't make it into
| |
| 7 | |
| 8 var scope = 'imports_bust_memcache_scope/*'; | |
| 9 var script = 'worker_with_one_import.js'; | |
| 10 | |
| 11 navigator.serviceWorker.unregister(scope) | |
| 12 .then(function(value) { | |
| 13 console.log('initial unregistration done'); | |
| 14 return navigator.serviceWorker.register(script, {scope: scope}); | |
| 15 }) | |
| 16 .then(function(worker) { | |
| 17 console.log('initial registration done'); | |
| 18 return navigator.serviceWorker.unregister(scope); | |
| 19 }) | |
| 20 .then(function(value) { | |
| 21 console.log('unregistration done'); | |
| 22 return navigator.serviceWorker.register(script, {scope: scope}); | |
| 23 }) | |
| 24 .then(function(worker) { | |
| 25 console.log('second registration done'); | |
| 26 document.title = 'OK'; // Titlewatcher looks for this. | |
| 27 }) | |
| 28 .catch(function(e) { | |
| 29 console.log('error will robinson!'); | |
| 30 document.title = 'FAILED'; | |
| 31 }); | |
| 32 </script> | |
| OLD | NEW |