OLD | NEW |
---|---|
(Empty) | |
1 <!DOCTYPE html> | |
2 <script> | |
3 // See ServiceWorkerBrowserTest ImportsBustMemcache. | |
4 // Content-shell data persists, so unreg first to clear old data. | |
dominicc (has gone to gerrit)
2014/08/04 01:27:10
Content-shell -> Content Shell
unreg - avoid abbre
| |
5 // Register, unregister, then reregister, the browsertest .cc code examines | |
dominicc (has gone to gerrit)
2014/08/04 01:27:10
then/the seems odd
| |
6 // the state of the scriptcache to ensure the script and import are cached. | |
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) { | |
dominicc (has gone to gerrit)
2014/08/04 01:27:10
This will become a registration object. Since it i
| |
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!'); | |
dominicc (has gone to gerrit)
2014/08/04 01:27:10
I think Will Robinson was warned of danger, not er
michaeln
2014/08/08 02:32:37
levity removed
| |
30 document.title = 'FAILED'; | |
31 }); | |
32 </script> | |
OLD | NEW |