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..fd0ffb26ea0e0d0909a1b0c70ffd32d0588c85fa 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,55 @@ 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'; |
| + 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() { |
| + return navigator.serviceWorker.register(worker_url, { scope: scope }); |
| + }) |
| + .then(function(r) { |
| + registration = r; |
| + service_worker = r.installing; |
| + assert_not_equals(r.installing, null, |
| + 'installing sw should exist after reloading'); |
| + assert_equals(r.active, null, |
| + 'active sw should be null after reloading'); |
|
nhiroki
2016/04/08 03:46:26
The purpose of these assertions is to check that t
shimazu (google)
2016/04/11 03:28:45
Done.
|
| + return wait_for_state(t, r.installing, 'activated'); |
| + }) |
| + .then(function() { |
| + assert_equals(registration.installing, null, |
| + 'installing sw should go to active after an ' + |
| + 'activated event fired'); |
| + assert_equals(registration.active, service_worker, |
| + 'installing sw should get activated after an ' + |
| + 'activated event fired'); |
| + service_worker_unregister_and_done(t, scope); |
| + }) |
| + .catch(unreached_rejection(t)); |
| + }, 'Unregister then register on the page containing iframe provided by SW ' + |
| + 'should renew the SW script.'); |
|
falken
2016/04/08 02:27:18
This description doesn't seem to capture what the
shimazu (google)
2016/04/11 03:28:45
Done.
|
| + |
| +async_test(function(t) { |
| var scope = 'resources/scope/re-register-does-not-affect-existing-controllee'; |
| var iframe; |
| var registration; |