| 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 c1fe6aa2edb0638936982fdcb8d1a27fa0770c5a..dd9f5f563f54a940dccf52d6d55d439e8d5b9277 100644
|
| --- a/chrome/test/data/push_messaging/push_test.js
|
| +++ b/chrome/test/data/push_messaging/push_test.js
|
| @@ -7,10 +7,17 @@
|
| var resultQueue = new ResultQueue();
|
| var pushSubscription = null;
|
|
|
| -var pushSubscriptionOptions = {
|
| +var pushSubscriptionOptionsWithoutKey = {
|
| userVisibleOnly: true
|
| };
|
|
|
| +var pushSubscriptionOptions = {
|
| + userVisibleOnly: true,
|
| + // TODO(harkness) When the validity of the public key is actually checked,
|
| + // this value will need to be updated.
|
| + appServicePublicKey: new ArrayBuffer("1234567890")
|
| +};
|
| +
|
| // Sends data back to the test. This must be in response to an earlier
|
| // request, but it's ok to respond asynchronously. The request blocks until
|
| // the response is sent.
|
| @@ -106,6 +113,19 @@ function swapManifestNoSenderId() {
|
| }
|
| }
|
|
|
| +// This is the old style of push subscriptions which we are phasing away
|
| +// from, where the subscription used a sender ID instead of public key.
|
| +function subscribePushWithoutKey() {
|
| + navigator.serviceWorker.ready.then(function(swRegistration) {
|
| + return swRegistration.pushManager.subscribe(
|
| + pushSubscriptionOptionsWithoutKey)
|
| + .then(function(subscription) {
|
| + pushSubscription = subscription;
|
| + sendResultToTest(subscription.endpoint);
|
| + });
|
| + }).catch(sendErrorToTest);
|
| +}
|
| +
|
| function subscribePush() {
|
| navigator.serviceWorker.ready.then(function(swRegistration) {
|
| return swRegistration.pushManager.subscribe(pushSubscriptionOptions)
|
|
|