Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/http/tests/serviceworker/unregister-then-register.html |
| diff --git a/third_party/WebKit/LayoutTests/http/tests/serviceworker/unregister-then-register.html b/third_party/WebKit/LayoutTests/http/tests/serviceworker/unregister-then-register.html |
| index cec2ddc85410777c300e6c0b14e1fdf958173378..c83c467b783047e7e84cf3795e5be50791aaa26b 100644 |
| --- a/third_party/WebKit/LayoutTests/http/tests/serviceworker/unregister-then-register.html |
| +++ b/third_party/WebKit/LayoutTests/http/tests/serviceworker/unregister-then-register.html |
| @@ -57,6 +57,45 @@ async_test(function(t) { |
| 'registration is in use.'); |
| async_test(function(t) { |
| + var scope = 'resources/scope/re-register-after-reloading-iframe-' + |
| + 'with-old-registration-in-use'; |
|
nhiroki
2016/04/12 04:19:10
This scope name looks outdated. Can you update thi
shimazu (google)
2016/04/12 05:22:29
Done.
|
| + var registration; |
| + var frame; |
| + var service_worker; |
| + service_worker_unregister_and_register(t, worker_url, scope) |
| + .then(function(r) { |
| + registration = r; |
| + return wait_for_state(t, r.installing, 'activated'); |
| + }) |
| + .then(function() { |
| + return with_iframe(scope); |
| + }) |
| + .then(function(f) { |
| + frame = f; |
| + return registration.unregister(); |
| + }) |
| + .then(function() { |
| + return new Promise(function(resolve) { |
| + frame.onload = resolve; |
| + frame.contentWindow.location.reload(); |
| + }); |
| + }) |
| + .then(function() { |
| + var c = frame.contentWindow.navigator.serviceWorker.controller; |
| + assert_equals(c, null, 'a page after unregistration should not be ' + |
| + 'controlled by service worker'); |
| + return navigator.serviceWorker.getRegistration(scope); |
| + }) |
| + .then(function(r) { |
| + assert_equals(r, undefined, 'getRegistration should return ' + |
| + 'undefined after unregistration'); |
| + service_worker_unregister_and_done(t, scope); |
| + }) |
| + .catch(unreached_rejection(t)); |
| +}, 'Reloading the last controlled iframe after unregistration should ensure ' + |
| + 'the deletion of the registration'); |
| + |
| +async_test(function(t) { |
| var scope = 'resources/scope/re-register-does-not-affect-existing-controllee'; |
| var iframe; |
| var registration; |