OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <title>ServiceWorkerGlobalScope: unregister</title> | 2 <title>ServiceWorkerGlobalScope: unregister</title> |
3 <script src='../../resources/testharness.js'></script> | 3 <script src='/resources/testharness.js'></script> |
4 <script src='../../resources/testharnessreport.js'></script> | 4 <script src='/resources/testharnessreport.js'></script> |
5 <script src='../resources/test-helpers.js'></script> | 5 <script src='../resources/test-helpers.sub.js'></script> |
6 <script> | 6 <script> |
7 | 7 |
8 promise_test(function(t) { | 8 promise_test(function(t) { |
9 var script = 'resources/unregister-worker.js?evaluation'; | 9 var script = 'resources/unregister-worker.js?evaluation'; |
10 var scope = 'resources/scope/unregister-on-script-evaluation'; | 10 var scope = 'resources/scope/unregister-on-script-evaluation'; |
11 | 11 |
12 return service_worker_unregister_and_register(t, script, scope) | 12 return service_worker_unregister_and_register(t, script, scope) |
13 .then(function(registration) { | 13 .then(function(registration) { |
14 return wait_for_state(t, registration.installing, 'redundant'); | 14 return wait_for_state(t, registration.installing, 'redundant'); |
15 }) | 15 }) |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 assert_equals( | 60 assert_equals( |
61 result, | 61 result, |
62 undefined, | 62 undefined, |
63 'After unregister(), the registration should not found'); | 63 'After unregister(), the registration should not found'); |
64 return service_worker_unregister_and_done(t, scope); | 64 return service_worker_unregister_and_done(t, scope); |
65 }); | 65 }); |
66 }, 'Unregister on activate event'); | 66 }, 'Unregister on activate event'); |
67 | 67 |
68 promise_test(function(t) { | 68 promise_test(function(t) { |
69 var script = 'resources/unregister-worker.js'; | 69 var script = 'resources/unregister-worker.js'; |
70 var scope = 'resources/unregister-controlling-worker'; | 70 var scope = 'resources/unregister-controlling-worker.html'; |
71 | 71 |
72 var controller; | 72 var controller; |
73 var frame; | 73 var frame; |
74 | 74 |
75 return service_worker_unregister_and_register(t, script, scope) | 75 return service_worker_unregister_and_register(t, script, scope) |
76 .then(function(registration) { | 76 .then(function(registration) { |
77 return wait_for_state(t, registration.installing, 'activated'); | 77 return wait_for_state(t, registration.installing, 'activated'); |
78 }) | 78 }) |
79 .then(function() { return with_iframe(scope); }) | 79 .then(function() { return with_iframe(scope); }) |
80 .then(function(f) { | 80 .then(function(f) { |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 null, | 118 null, |
119 'After unregister(), the worker should not control a new document'); | 119 'After unregister(), the worker should not control a new document'); |
120 | 120 |
121 frame.remove(); | 121 frame.remove(); |
122 new_frame.remove(); | 122 new_frame.remove(); |
123 return service_worker_unregister_and_done(t, scope); | 123 return service_worker_unregister_and_done(t, scope); |
124 }) | 124 }) |
125 }, 'Unregister controlling service worker'); | 125 }, 'Unregister controlling service worker'); |
126 | 126 |
127 </script> | 127 </script> |
OLD | NEW |