Bug 1219063, Part 2 - Remove obsolete "push" permission. r=mt a=ritu
authorKit Cambridge <kcambridge@mozilla.com>
Fri, 30 Oct 2015 18:16:19 -0700
changeset 305890 24692f1a19390593f823d3056805fa3988c29457
parent 305889 d14a19cedf0ccc55905adb3af41eeca4031c15ce
child 305891 3bb6c2232c8d9890510f794cec0160b604e7afbf
push id1001
push userraliiev@mozilla.com
push dateMon, 18 Jan 2016 19:06:03 +0000
treeherdermozilla-release@8b89261f3ac4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmt, ritu
bugs1219063
milestone44.0
Bug 1219063, Part 2 - Remove obsolete "push" permission. r=mt a=ritu
dom/push/PushService.jsm
dom/push/test/test_serviceworker_lifetime.html
dom/push/test/xpcshell/head.js
dom/push/test/xpcshell/test_permissions.js
--- a/dom/push/PushService.jsm
+++ b/dom/push/PushService.jsm
@@ -1372,17 +1372,17 @@ this.PushService = {
           }
           return true;
         }
         return false;
       });
     }
 
     let permission = subject.QueryInterface(Ci.nsIPermission);
-    if (permission.type != "push") {
+    if (permission.type != "desktop-notification") {
       return Promise.resolve();
     }
 
     return this._updatePermission(permission, data);
   },
 
   _updatePermission: function(permission, type) {
     debug("updatePermission()");
--- a/dom/push/test/test_serviceworker_lifetime.html
+++ b/dom/push/test/test_serviceworker_lifetime.html
@@ -322,13 +322,13 @@
 
   SpecialPowers.pushPrefEnv({"set": [
     ["dom.push.enabled", true],
     ["dom.serviceWorkers.exemptFromPerDomainMax", true],
     ["dom.serviceWorkers.enabled", true],
     ["dom.serviceWorkers.testing.enabled", true],
     ["dom.serviceWorkers.interception.enabled", true]
     ]}, runTest);
-  SpecialPowers.addPermission('push', true, document);
+  SpecialPowers.addPermission('desktop-notification', true, document);
   SimpleTest.waitForExplicitFinish();
 </script>
 </body>
 </html>
--- a/dom/push/test/xpcshell/head.js
+++ b/dom/push/test/xpcshell/head.js
@@ -175,17 +175,17 @@ function makeStub(target, stubs) {
  * for testing nsIPushNotificationService.
  *
  * @param {String[]} scopes A list of scope URLs.
  */
 function disableServiceWorkerEvents(...scopes) {
   for (let scope of scopes) {
     Services.perms.add(
       Services.io.newURI(scope, null, null),
-      'push',
+      'desktop-notification',
       Ci.nsIPermissionManager.DENY_ACTION
     );
   }
 }
 
 /**
  * Sets default PushService preferences. All pref names are prefixed with
  * `dom.push.`; any additional preferences will override the defaults.
--- a/dom/push/test/xpcshell/test_permissions.js
+++ b/dom/push/test/xpcshell/test_permissions.js
@@ -40,17 +40,17 @@ function makePushPermission(url, capabil
   return {
     QueryInterface: XPCOMUtils.generateQI([Ci.nsIPermission]),
     capability: Ci.nsIPermissionManager[capability],
     expireTime: 0,
     expireType: Ci.nsIPermissionManager.EXPIRE_NEVER,
     principal: Services.scriptSecurityManager.getCodebasePrincipal(
       Services.io.newURI(url, null, null)
     ),
-    type: 'push',
+    type: 'desktop-notification',
   };
 }
 
 function promiseSubscriptionChanges(count) {
   let notifiedScopes = [];
   let subChangePromise = promiseObserverNotification('push-subscription-change', (subject, data) => {
     notifiedScopes.push(data);
     return notifiedScopes.length == count;