| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <script src="../resources/testharness.js"></script> | 2 <script src="../resources/testharness.js"></script> |
| 3 <script src="../resources/testharnessreport.js"></script> | 3 <script src="../resources/testharnessreport.js"></script> |
| 4 <script src="resources/test-helpers.js"></script> | 4 <script src="resources/test-helpers.js"></script> |
| 5 <script> | 5 <script> |
| 6 var worker_url = 'resources/simple-intercept-worker.js'; | 6 var worker_url = 'resources/simple-intercept-worker.js'; |
| 7 | 7 |
| 8 async_test(function(t) { | 8 async_test(function(t) { |
| 9 var scope = | 9 var scope = |
| 10 'resources/unregister-controller-page.html?load-before-unregister'; | 10 'resources/unregister-controller-page.html?load-before-unregister'; |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 .then(function(response) { | 72 .then(function(response) { |
| 73 assert_equals(response, 'a simple text file\n', | 73 assert_equals(response, 'a simple text file\n', |
| 74 'requests should not be intercepted'); | 74 'requests should not be intercepted'); |
| 75 t.done(); | 75 t.done(); |
| 76 }) | 76 }) |
| 77 .catch(unreached_rejection(t)); | 77 .catch(unreached_rejection(t)); |
| 78 }, 'Unregister prevents control of subsequent navigations'); | 78 }, 'Unregister prevents control of subsequent navigations'); |
| 79 | 79 |
| 80 async_test(function(t) { | 80 async_test(function(t) { |
| 81 var scope = | 81 var scope = |
| 82 'scope/no-new-controllee-even-if-registration-is-still-used'; | 82 'resources/scope/no-new-controllee-even-if-registration-is-still-used'; |
| 83 var registration; | 83 var registration; |
| 84 | 84 |
| 85 service_worker_unregister_and_register(t, worker_url, scope) | 85 service_worker_unregister_and_register(t, worker_url, scope) |
| 86 .then(function(r) { | 86 .then(function(r) { |
| 87 registration = r; | 87 registration = r; |
| 88 return wait_for_update(t, registration); | 88 return wait_for_update(t, registration); |
| 89 }) | 89 }) |
| 90 .then(function(worker) { | 90 .then(function(worker) { |
| 91 return wait_for_state(t, worker, 'activated'); | 91 return wait_for_state(t, worker, 'activated'); |
| 92 }) | 92 }) |
| 93 .then(function() { | 93 .then(function() { |
| 94 return with_iframe(scope); | 94 return with_iframe(scope); |
| 95 }) | 95 }) |
| 96 .then(function(frame) { | 96 .then(function(frame) { |
| 97 return registration.unregister(); | 97 return registration.unregister(); |
| 98 }) | 98 }) |
| 99 .then(function() { | 99 .then(function() { |
| 100 return with_iframe(scope); | 100 return with_iframe(scope); |
| 101 }) | 101 }) |
| 102 .then(function(frame) { | 102 .then(function(frame) { |
| 103 assert_equals(frame.contentWindow.navigator.serviceWorker.controller, | 103 assert_equals(frame.contentWindow.navigator.serviceWorker.controller, |
| 104 null, | 104 null, |
| 105 'document should not have a controller'); | 105 'document should not have a controller'); |
| 106 t.done(); | 106 t.done(); |
| 107 }) | 107 }) |
| 108 .catch(unreached_rejection(t)); | 108 .catch(unreached_rejection(t)); |
| 109 }, 'Unregister prevents new controllee even if registration is still in use'); | 109 }, 'Unregister prevents new controllee even if registration is still in use'); |
| 110 </script> | 110 </script> |
| OLD | NEW |