Chromium Code Reviews| Index: LayoutTests/http/tests/push_messaging/unregister.html |
| diff --git a/LayoutTests/http/tests/push_messaging/unregister.html b/LayoutTests/http/tests/push_messaging/unregister.html |
| index e0e135bfb7ff18604df927b2d9949fce8a345728..a6acaf07c59310bc32e56341a6596210d9cfcc2c 100644 |
| --- a/LayoutTests/http/tests/push_messaging/unregister.html |
| +++ b/LayoutTests/http/tests/push_messaging/unregister.html |
| @@ -13,6 +13,7 @@ async_test(function(test) { |
| var workerUrl = 'resources/empty_worker.js'; |
| var workerScope = 'resources/scope/' + location.pathname; |
| var swRegistration; |
| + var pushRegistration; |
| service_worker_unregister_and_register(test, workerUrl, workerScope) |
| .then(function(serviceWorkerRegistration) { |
| swRegistration = serviceWorkerRegistration; |
| @@ -24,19 +25,23 @@ async_test(function(test) { |
| testRunner.setPushMessagingPermission(location.origin, true); |
| return swRegistration.pushManager.register(); |
| }) |
| - .then(function(pushRegistration) { |
| + .then(function(registration) { |
| + pushRegistration = registration; |
| return pushRegistration.unregister(); |
| }) |
| .then(function(unregistration_result) { |
|
Michael van Ouwerkerk
2014/12/12 13:59:48
Please rename this to something more meaningful e.
|
| - assert_true(unregistration_result); |
| - // FIXME: we should add another call to unregister(). It should then |
| - // fail. |
| + assert_true(unregistration_result, "unregister() called when correctly registered should be fulfilled with true"); |
|
Michael van Ouwerkerk
2014/12/12 13:59:48
s/fulfilled/resolved/ also below
|
| + return pushRegistration.unregister(); |
| + }) |
| + .then(function(unregistration_result) { |
| + assert_false(unregistration_result, "unregister() called a second time should be fulfilled with false"); |
| + |
| // FIXME: we should check that there is no more push registration |
| // object available if we query the registrations. |
| return service_worker_unregister_and_done(test, workerScope); |
| }) |
| .catch(unreached_rejection(test)); |
| -}, 'unregister() succeeds if called after a successful registration'); |
| +}); |
| </script> |
| </body> |
| </html> |