Chromium Code Reviews| Index: chrome/test/data/push_messaging/push_test.js |
| diff --git a/chrome/test/data/push_messaging/push_test.js b/chrome/test/data/push_messaging/push_test.js |
| index f47003052ef7b7de6eda713b575ec7f19f03a615..1440b7051eeef96288e23a197fbc887772204ee4 100644 |
| --- a/chrome/test/data/push_messaging/push_test.js |
| +++ b/chrome/test/data/push_messaging/push_test.js |
| @@ -137,6 +137,15 @@ function unregister() { |
| }); |
| } |
| +function hasRegistration() { |
| + navigator.serviceWorker.ready.then(function(swRegistration) { |
| + return swRegistration.pushManager.getSubscription(); |
| + }).then(function(subscription) { |
| + subscription ? sendResultToTest('true - registered') |
|
johnme
2015/02/16 20:27:45
sendResultToTest(subscription ? 'true - registered
mlamouri (slow - plz ping)
2015/02/16 20:46:03
Done.
|
| + : sendResultToTest('false - not registered'); |
| + }).catch(sendErrorToTest); |
| +} |
| + |
| addEventListener('message', function(event) { |
| var message = JSON.parse(event.data); |
| if (message.type == 'push') |