| 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 5702267b6dced4fb2432f198a416b43fa0afaaa2..2ddec8924a03b4c0557123d2797487bdf0e0df23 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,7 +25,8 @@ async_test(function(test) {
|
| testRunner.setPushMessagingPermission(location.origin, true);
|
| return swRegistration.pushManager.register();
|
| })
|
| - .then(function(pushRegistration) {
|
| + .then(function(registration) {
|
| + pushRegistration = registration;
|
| assert_inherits(pushRegistration, 'unregister',
|
| 'unregister() should be exposed on the PushRegistration object');
|
| assert_equals(typeof(pushRegistration.unregister), 'function',
|
| @@ -33,15 +35,21 @@ async_test(function(test) {
|
| })
|
| .then(function(unregistration_result) {
|
| assert_true(unregistration_result,
|
| - 'Unregistering a registered PushRegistration should succeed.');
|
| - // FIXME: we should add another call to unregister(). It should then
|
| - // fail.
|
| - // FIXME: we should check that there is no more push registration
|
| - // object available if we query the registrations.
|
| + "unregister() called when correctly registered should be fulfilled with true");
|
| + return pushRegistration.unregister();
|
| + })
|
| + .then(function(unregistration_result) {
|
| + assert_false(unregistration_result,
|
| + "unregister() called a second time should be fulfilled with false");
|
| + return swRegistration.pushManager.getRegistration();
|
| + })
|
| + .then(function(pushRegistration) {
|
| + assert_equals(pushRegistration, null,
|
| + "After unregistration, there is no more PushRegistration.");
|
| return service_worker_unregister_and_done(test, workerScope);
|
| })
|
| .catch(unreached_rejection(test));
|
| -}, 'unregister() succeeds if called after a successful registration');
|
| +});
|
| </script>
|
| </body>
|
| </html>
|
|
|