Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5655)

Unified Diff: chrome/test/data/push_messaging/push_test.js

Issue 2460223004: Fix potential bug in push_test.js - do not cache subscription options (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 73907ba5f1124e4b56e410bb4b720a00c39f1463..7837ab7e0d1f105b2c1ea10444b1e1c6690567bb 100644
--- a/chrome/test/data/push_messaging/push_test.js
+++ b/chrome/test/data/push_messaging/push_test.js
@@ -8,10 +8,6 @@
// framework.
var resultQueue = new ResultQueue();
-var pushSubscriptionOptions = {
- userVisibleOnly: true
-};
-
// Waits for the given ServiceWorkerRegistration to become ready.
// Shim for https://github.com/w3c/ServiceWorker/issues/770.
function swRegistrationReady(reg) {
@@ -94,6 +90,9 @@ function swapManifestNoSenderId() {
// from, where the subscription used a sender ID instead of public key.
function documentSubscribePushWithoutKey() {
navigator.serviceWorker.ready.then(function(swRegistration) {
+ let pushSubscriptionOptions = {
+ userVisibleOnly: true
+ };
return swRegistration.pushManager.subscribe(
pushSubscriptionOptions)
Peter Beverloo 2016/10/31 17:30:20 I see failing tests. Is it possible that subscribi
Peter Beverloo 2016/10/31 17:30:20 nit: consider inlining the dictionary
awdf 2016/10/31 17:35:02 Huh, that's weird, I thought they might but I'm pr
awdf 2016/10/31 18:35:40 Done.
.then(function(subscription) {
@@ -104,7 +103,10 @@ function documentSubscribePushWithoutKey() {
function documentSubscribePush() {
navigator.serviceWorker.ready.then(function(swRegistration) {
- pushSubscriptionOptions.applicationServerKey = kApplicationServerKey.buffer;
+ let pushSubscriptionOptions = {
awdf 2016/10/31 18:35:40 ah did you prefer this one not inlined actually? i
+ userVisibleOnly: true,
+ applicationServerKey: kApplicationServerKey.buffer
+ };
return swRegistration.pushManager.subscribe(pushSubscriptionOptions)
.then(function(subscription) {
sendResultToTest(subscription.endpoint);
@@ -136,6 +138,9 @@ function GetP256dh() {
function permissionState() {
navigator.serviceWorker.ready.then(function(swRegistration) {
+ let pushSubscriptionOptions = {
+ userVisibleOnly: true
+ };
return swRegistration.pushManager.permissionState(pushSubscriptionOptions)
Peter Beverloo 2016/10/31 17:30:20 nit: consider inlining the dictionary
awdf 2016/10/31 18:35:40 Done.
.then(function(permission) {
sendResultToTest('permission status - ' + permission);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698