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 180f1a622860570361433804d1dc4c6b9e53575f..0ca431a336287de698c58f28c02e5ae6ac94fbca 100644 |
| --- a/chrome/test/data/push_messaging/push_test.js |
| +++ b/chrome/test/data/push_messaging/push_test.js |
| @@ -119,6 +119,18 @@ function documentSubscribePush() { |
| }).catch(sendErrorToTest); |
| } |
| +function documentSubscribePushWithNumber() { |
|
harkness
2016/11/02 18:48:12
nit NumericKey ?
awdf
2016/11/03 14:10:11
Done.
|
| + navigator.serviceWorker.ready.then(function(swRegistration) { |
| + return swRegistration.pushManager.subscribe({ |
| + userVisibleOnly: true, |
| + applicationServerKey: new TextEncoder().encode('1234567890') |
| + }) |
| + .then(function(subscription) { |
| + sendResultToTest(subscription.endpoint); |
| + }); |
| + }).catch(sendErrorToTest); |
| +} |
| + |
| function workerSubscribePush() { |
| // Send the message to the worker for it to subscribe |
| navigator.serviceWorker.controller.postMessage({command: 'workerSubscribe'}); |
| @@ -131,6 +143,12 @@ function workerSubscribePushNoKey() { |
| {command: 'workerSubscribeNoKey'}); |
| } |
| +function workerSubscribePushWithNumber() { |
| + // Send the message to the worker for it to subscribe |
| + navigator.serviceWorker.controller.postMessage( |
| + {command: 'workerSubscribeWithNumber'}); |
| +} |
| + |
| function GetP256dh() { |
| navigator.serviceWorker.ready.then(function(swRegistration) { |
| return swRegistration.pushManager.getSubscription() |