| 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..d4790fa35890c0c0f6dee09caa5e61f95b0e30b2 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 documentSubscribePushWithNumericKey() {
|
| + 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'});
|
| @@ -126,11 +138,18 @@ function workerSubscribePush() {
|
|
|
| function workerSubscribePushNoKey() {
|
| // The worker will try to subscribe without providing a key. This should
|
| - // succeed if the worker was previously subscribed and fail otherwise.
|
| + // succeed if the worker was previously subscribed with a numeric key
|
| + // and fail otherwise.
|
| navigator.serviceWorker.controller.postMessage(
|
| {command: 'workerSubscribeNoKey'});
|
| }
|
|
|
| +function workerSubscribePushWithNumericKey() {
|
| + // Send the message to the worker for it to subscribe
|
| + navigator.serviceWorker.controller.postMessage(
|
| + {command: 'workerSubscribeWithNumericKey'});
|
| +}
|
| +
|
| function GetP256dh() {
|
| navigator.serviceWorker.ready.then(function(swRegistration) {
|
| return swRegistration.pushManager.getSubscription()
|
|
|