| 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/empty-worker.js'; | 6 var worker_url = 'resources/empty-worker.js'; |
| 7 | 7 |
| 8 async_test(function(t) { | 8 async_test(function(t) { |
| 9 var scope = 'resources/scope/re-register-resolves-to-new-value'; | 9 var scope = 'resources/scope/re-register-resolves-to-new-value'; |
| 10 var iframe; | 10 var iframe; |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 .then(function() { | 41 .then(function() { |
| 42 return with_iframe(scope); | 42 return with_iframe(scope); |
| 43 }) | 43 }) |
| 44 .then(function(frame) { | 44 .then(function(frame) { |
| 45 return registration.unregister(); | 45 return registration.unregister(); |
| 46 }) | 46 }) |
| 47 .then(function() { | 47 .then(function() { |
| 48 return navigator.serviceWorker.register(worker_url, { scope: scope }); | 48 return navigator.serviceWorker.register(worker_url, { scope: scope }); |
| 49 }) | 49 }) |
| 50 .then(function(new_registration) { | 50 .then(function(new_registration) { |
| 51 assert_equals(registration, new_registration, | 51 assert_registration_equals( |
| 52 'register should resolve to the same value'); | 52 registration, new_registration, |
| 53 'register should resolve to the same registration'); |
| 53 service_worker_unregister_and_done(t, scope); | 54 service_worker_unregister_and_done(t, scope); |
| 54 }) | 55 }) |
| 55 .catch(unreached_rejection(t)); | 56 .catch(unreached_rejection(t)); |
| 56 }, 'Unregister then register resolves to the original value if the ' + | 57 }, 'Unregister then register resolves to the original value if the ' + |
| 57 'registration is in use.'); | 58 'registration is in use.'); |
| 58 | 59 |
| 59 async_test(function(t) { | 60 async_test(function(t) { |
| 60 var scope = 'resources/scope/re-register-does-not-affect-existing-controllee
'; | 61 var scope = 'resources/scope/re-register-does-not-affect-existing-controllee
'; |
| 61 var iframe; | 62 var iframe; |
| 62 var registration; | 63 var registration; |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 // FIXME: When crbug.com/400602 is fixed, assert that controller | 120 // FIXME: When crbug.com/400602 is fixed, assert that controller |
| 120 // equals the original worker. | 121 // equals the original worker. |
| 121 assert_not_equals( | 122 assert_not_equals( |
| 122 frame.contentWindow.navigator.serviceWorker.controller, null, | 123 frame.contentWindow.navigator.serviceWorker.controller, null, |
| 123 'document should have a controller'); | 124 'document should have a controller'); |
| 124 service_worker_unregister_and_done(t, scope); | 125 service_worker_unregister_and_done(t, scope); |
| 125 }) | 126 }) |
| 126 .catch(unreached_rejection(t)); | 127 .catch(unreached_rejection(t)); |
| 127 }, 'Unregister then register resurrects the registration'); | 128 }, 'Unregister then register resurrects the registration'); |
| 128 </script> | 129 </script> |
| OLD | NEW |