Chromium Code Reviews| Index: LayoutTests/http/tests/serviceworker/unregister.html |
| diff --git a/LayoutTests/http/tests/serviceworker/unregister.html b/LayoutTests/http/tests/serviceworker/unregister.html |
| index 29e312ed50cfd38efdf6bc20399de44b8aac1f77..4475bd478f7f305681fd702a97b76ca6b00b0d9c 100644 |
| --- a/LayoutTests/http/tests/serviceworker/unregister.html |
| +++ b/LayoutTests/http/tests/serviceworker/unregister.html |
| @@ -1,6 +1,7 @@ |
| <!DOCTYPE html> |
| <script src="../resources/testharness.js"></script> |
| <script src="../resources/testharnessreport.js"></script> |
| +<script src="resources/test-helpers.js"></script> |
| <script> |
| (function() { |
| var t = async_test('Unregistering out of origin'); |
| @@ -56,4 +57,28 @@ |
| }) |
| ); |
| }()); |
| + |
| +async_test(function(t) { |
| + var statePromise; |
|
dominicc (has gone to gerrit)
2014/07/10 06:19:37
state_promise
|
| + service_worker_unregister_and_register(t, 'resources/empty-worker.js'). |
|
dominicc (has gone to gerrit)
2014/07/10 06:19:37
Break before .
|
| + then(t.step_func(function(sw) { |
| + // FIXME; 'deactivated' should be 'redundant' crrev.com/352423005 |
|
dominicc (has gone to gerrit)
2014/07/03 04:44:35
FIXME; -> FIXME:
dominicc (has gone to gerrit)
2014/07/03 04:44:35
You could map redundant to deactivated inside wait
jsbell
2014/07/03 05:16:13
The CL to rename the states will land before this
|
| + statePromise = wait_for_state(t, sw, 'deactivated'); |
| + return navigator.serviceWorker.unregister(); |
| + })). |
| + then(t.step_func(function(value) { |
| + assert_equals(value, undefined, |
| + 'unregister with default scope should succeed'); |
| + return statePromise; |
| + })). |
| + then(t.step_func(function(state) { |
| + // FIXME; 'deactivated' should be 'redundant' crrev.com/352423005 |
| + assert_equals(state, 'deactivated', |
| + 'service worker registered with default scope ' + |
| + 'should be unregstered'); |
| + t.done(); |
| + })). |
| + catch(unreached_rejection(t)); |
| + |
| +}, 'Unregistering with default scope'); |
| </script> |