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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 'document should not have a controller'); | 61 'document should not have a controller'); |
62 return frame_window.fetch_url('simple.txt'); | 62 return frame_window.fetch_url('simple.txt'); |
63 }) | 63 }) |
64 .then(function(response) { | 64 .then(function(response) { |
65 assert_equals(response, 'a simple text file\n', | 65 assert_equals(response, 'a simple text file\n', |
66 'requests should not be intercepted'); | 66 'requests should not be intercepted'); |
67 t.done(); | 67 t.done(); |
68 }) | 68 }) |
69 .catch(unreached_rejection(t)); | 69 .catch(unreached_rejection(t)); |
70 }, 'Unregister prevents control of subsequent navigations'); | 70 }, 'Unregister prevents control of subsequent navigations'); |
| 71 |
| 72 async_test(function(t) { |
| 73 var scope = |
| 74 'scope/no-new-controllee-even-if-registration-is-still-used'; |
| 75 |
| 76 service_worker_unregister_and_register(t, worker_url, scope) |
| 77 .then(function(registered_worker) { |
| 78 return wait_for_state(t, registered_worker, 'activated'); |
| 79 }) |
| 80 .then(function() { |
| 81 return with_iframe(scope); |
| 82 }) |
| 83 .then(function(frame) { |
| 84 return navigator.serviceWorker.unregister(scope); |
| 85 }) |
| 86 .then(function() { |
| 87 return with_iframe(scope); |
| 88 }) |
| 89 .then(function(frame) { |
| 90 assert_equals(frame.contentWindow.navigator.serviceWorker.controller, |
| 91 null, |
| 92 'document should not have a controller'); |
| 93 t.done(); |
| 94 }) |
| 95 .catch(unreached_rejection(t)); |
| 96 }, 'Unregister prevents new controllee even if registration is still in use'); |
71 </script> | 97 </script> |
OLD | NEW |