| 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..be99f626758be52981619306697ee0e4d1853747 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) {
|
| + sendResultToTest(subscription ? 'true - registered'
|
| + : 'false - not registered');
|
| + }).catch(sendErrorToTest);
|
| +}
|
| +
|
| addEventListener('message', function(event) {
|
| var message = JSON.parse(event.data);
|
| if (message.type == 'push')
|
|
|