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

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

Issue 930083002: Unregister with push service and SW database when permission is lost. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add copy ctor Created 5 years, 10 months 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
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')

Powered by Google App Engine
This is Rietveld 408576698