Bug 1310910 - Remove ChromeNotifications; r=baku
authorEhsan Akhgari <ehsan@mozilla.com>
Tue, 18 Oct 2016 00:23:44 -0400
changeset 318445 b1e0caca8bc1fc2f0dd964a1d2259258c3978fdb
parent 318444 6e6f78b3cc413ffccc9d9f0cc4341e1130074573
child 318446 7d868cd247b56716565f1a37972d18c2494cd947
push id20718
push userphilringnalda@gmail.com
push dateWed, 19 Oct 2016 02:58:22 +0000
treeherderfx-team@f52b380bc02e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbaku
bugs1310910, 967475
milestone52.0a1
Bug 1310910 - Remove ChromeNotifications; r=baku This partially backs out bug 967475.
b2g/components/AlertsHelper.jsm
b2g/components/AlertsService.js
b2g/installer/package-manifest.in
browser/installer/package-manifest.in
dom/interfaces/notification/moz.build
dom/interfaces/notification/nsIDOMDesktopNotification.idl
dom/notification/ChromeNotifications.js
dom/notification/ChromeNotifications.manifest
dom/notification/DesktopNotification.cpp
dom/notification/Notification.cpp
dom/notification/NotificationDB.jsm
dom/notification/moz.build
dom/tests/mochitest/notification/MockServices.js
dom/tests/mochitest/notification/chrome.ini
dom/tests/mochitest/notification/desktop-notification/notification_common.js
dom/tests/mochitest/notification/test_notification_noresend.html
dom/tests/moz.build
dom/webidl/ChromeNotifications.webidl
dom/webidl/moz.build
mobile/android/installer/package-manifest.in
--- a/b2g/components/AlertsHelper.jsm
+++ b/b2g/components/AlertsHelper.jsm
@@ -51,23 +51,20 @@ const kDesktopNotificationClose = "deskt
 
 const kTopicAlertClickCallback = "alertclickcallback";
 const kTopicAlertShow          = "alertshow";
 const kTopicAlertFinished      = "alertfinished";
 
 const kMozChromeNotificationEvent  = "mozChromeNotificationEvent";
 const kMozContentNotificationEvent = "mozContentNotificationEvent";
 
-const kMessageAppNotificationSend    = "app-notification-send";
-const kMessageAppNotificationReturn  = "app-notification-return";
 const kMessageAlertNotificationSend  = "alert-notification-send";
 const kMessageAlertNotificationClose = "alert-notification-close";
 
 const kMessages = [
-  kMessageAppNotificationSend,
   kMessageAlertNotificationSend,
   kMessageAlertNotificationClose
 ];
 
 var AlertsHelper = {
 
   _listeners: {},
 
@@ -127,45 +124,16 @@ var AlertsHelper = {
       topic = kTopicAlertFinished;
     }
 
     if (listener.cookie) {
       try {
         listener.observer.observe(null, topic, listener.cookie);
       } catch (e) { }
     } else {
-      try {
-        listener.mm.sendAsyncMessage(kMessageAppNotificationReturn, {
-          uid: uid,
-          topic: topic,
-          target: listener.target
-        });
-      } catch (e) {
-        // we get an exception if the app is not launched yet
-        if (detail.type !== kDesktopNotificationShow) {
-          // excluding the 'show' event: there is no reason a unlaunched app
-          // would want to be notified that a notification is shown. This
-          // happens when a notification is still displayed at reboot time.
-          gSystemMessenger.sendMessage(kNotificationSystemMessageName, {
-              clicked: (detail.type === kDesktopNotificationClick),
-              title: listener.title,
-              body: listener.text,
-              imageURL: listener.imageURL,
-              lang: listener.lang,
-              dir: listener.dir,
-              id: listener.id,
-              tag: listener.tag,
-              timestamp: listener.timestamp,
-              data: listener.dataObj
-            },
-            Services.io.newURI(listener.target, null, null),
-            Services.io.newURI(listener.manifestURL, null, null)
-          );
-        }
-      }
       if (detail.type === kDesktopNotificationClose && listener.dbId) {
         notificationStorage.delete(listener.manifestURL, listener.dbId);
       }
     }
 
     // we"re done with this notification
     if (detail.type === kDesktopNotificationClose) {
       delete this._listeners[uid];
@@ -275,61 +243,32 @@ var AlertsHelper = {
 
     let dataObj = this.deserializeStructuredClone(data.dataStr);
     this.registerListener(data.name, data.cookie, data.alertListener);
     this.showNotification(data.imageURL, data.title, data.text,
                           data.textClickable, data.cookie, data.name, data.dir,
                           data.lang, dataObj, null, data.inPrivateBrowsing);
   },
 
-  showAppNotification: function(aMessage) {
-    let data = aMessage.data;
-    let details = data.details;
-    let dataObject = this.deserializeStructuredClone(details.data);
-    let listener = {
-      mm: aMessage.target,
-      title: data.title,
-      text: data.text,
-      manifestURL: details.manifestURL,
-      imageURL: data.imageURL,
-      lang: details.lang || undefined,
-      id: details.id || undefined,
-      dbId: details.dbId || undefined,
-      dir: details.dir || undefined,
-      tag: details.tag || undefined,
-      timestamp: details.timestamp || undefined,
-      dataObj: dataObject || undefined
-    };
-    this.registerAppListener(data.uid, listener);
-    this.showNotification(data.imageURL, data.title, data.text,
-                          details.textClickable, null, data.uid, details.dir,
-                          details.lang, dataObject, details.manifestURL,
-                          details.timestamp, details.mozbehavior);
-  },
-
   closeAlert: function(name) {
     SystemAppProxy._sendCustomEvent(kMozChromeNotificationEvent, {
       type: kDesktopNotificationClose,
       id: name
     });
   },
 
   receiveMessage: function(aMessage) {
     if (!aMessage.target.assertAppHasPermission(kDesktopNotificationPerm)) {
       Cu.reportError("Desktop-notification message " + aMessage.name +
                      " from a content process with no " + kDesktopNotificationPerm +
                      " privileges.");
       return;
     }
 
     switch(aMessage.name) {
-      case kMessageAppNotificationSend:
-        this.showAppNotification(aMessage);
-        break;
-
       case kMessageAlertNotificationSend:
         this.showAlertNotification(aMessage);
         break;
 
       case kMessageAlertNotificationClose:
         this.closeAlert(aMessage.data.name);
         break;
     }
--- a/b2g/components/AlertsService.js
+++ b/b2g/components/AlertsService.js
@@ -31,41 +31,36 @@ function debug(str) {
 }
 
 // -----------------------------------------------------------------------
 // Alerts Service
 // -----------------------------------------------------------------------
 
 const kNotificationSystemMessageName = "notification";
 
-const kMessageAppNotificationSend    = "app-notification-send";
-const kMessageAppNotificationReturn  = "app-notification-return";
 const kMessageAlertNotificationSend  = "alert-notification-send";
 const kMessageAlertNotificationClose = "alert-notification-close";
 
 const kTopicAlertShow          = "alertshow";
 const kTopicAlertFinished      = "alertfinished";
 const kTopicAlertClickCallback = "alertclickcallback";
 
 function AlertsService() {
   Services.obs.addObserver(this, "xpcom-shutdown", false);
-  cpmm.addMessageListener(kMessageAppNotificationReturn, this);
 }
 
 AlertsService.prototype = {
   classID: Components.ID("{fe33c107-82a4-41d6-8c64-5353267e04c9}"),
   QueryInterface: XPCOMUtils.generateQI([Ci.nsIAlertsService,
-                                         Ci.nsIAppNotificationService,
                                          Ci.nsIObserver]),
 
   observe: function(aSubject, aTopic, aData) {
     switch (aTopic) {
       case "xpcom-shutdown":
         Services.obs.removeObserver(this, "xpcom-shutdown");
-        cpmm.removeMessageListener(kMessageAppNotificationReturn, this);
         break;
     }
   },
 
   // nsIAlertsService
   showAlert: function(aAlert, aAlertListener) {
     if (!aAlert) {
       return;
@@ -99,87 +94,31 @@ AlertsService.prototype = {
   },
 
   closeAlert: function(aName) {
     cpmm.sendAsyncMessage(kMessageAlertNotificationClose, {
       name: aName
     });
   },
 
-  // nsIAppNotificationService
-  showAppNotification: function(aImageURL, aTitle, aText, aAlertListener,
-                                aDetails) {
-    let uid = (aDetails.id == "") ?
-          "app-notif-" + uuidGenerator.generateUUID() : aDetails.id;
-
-    let dataObj = this.deserializeStructuredClone(aDetails.data);
-    this._listeners[uid] = {
-      observer: aAlertListener,
-      title: aTitle,
-      text: aText,
-      manifestURL: aDetails.manifestURL,
-      imageURL: aImageURL,
-      lang: aDetails.lang || undefined,
-      id: aDetails.id || undefined,
-      dbId: aDetails.dbId || undefined,
-      dir: aDetails.dir || undefined,
-      tag: aDetails.tag || undefined,
-      timestamp: aDetails.timestamp || undefined,
-      dataObj: dataObj || undefined
-    };
-
-    cpmm.sendAsyncMessage(kMessageAppNotificationSend, {
-      imageURL: aImageURL,
-      title: aTitle,
-      text: aText,
-      uid: uid,
-      details: aDetails
-    });
-  },
-
   // AlertsService.js custom implementation
   _listeners: [],
 
   receiveMessage: function(aMessage) {
     let data = aMessage.data;
     let listener = this._listeners[data.uid];
-    if (aMessage.name !== kMessageAppNotificationReturn || !listener) {
+    if (!listener) {
       return;
     }
 
     let topic = data.topic;
 
     try {
       listener.observer.observe(null, topic, null);
     } catch (e) {
-      // It seems like there is no callbacks anymore, forward the click on
-      // notification via a system message containing the title/text/icon of
-      // the notification so the app get a change to react.
-      if (data.target) {
-        if (topic !== kTopicAlertShow) {
-          // excluding the 'show' event: there is no reason a unlaunched app
-          // would want to be notified that a notification is shown. This
-          // happens when a notification is still displayed at reboot time.
-          gSystemMessenger.sendMessage(kNotificationSystemMessageName, {
-              clicked: (topic === kTopicAlertClickCallback),
-              title: listener.title,
-              body: listener.text,
-              imageURL: listener.imageURL,
-              lang: listener.lang,
-              dir: listener.dir,
-              id: listener.id,
-              tag: listener.tag,
-              timestamp: listener.timestamp,
-              data: listener.dataObj || undefined,
-            },
-            Services.io.newURI(data.target, null, null),
-            Services.io.newURI(listener.manifestURL, null, null)
-          );
-        }
-      }
       if (topic === kTopicAlertFinished && listener.dbId) {
         notificationStorage.delete(listener.manifestURL, listener.dbId);
       }
     }
 
     // we're done with this notification
     if (topic === kTopicAlertFinished) {
       delete this._listeners[data.uid];
--- a/b2g/installer/package-manifest.in
+++ b/b2g/installer/package-manifest.in
@@ -335,18 +335,16 @@
 @RESPATH@/components/xpcom_xpti.xpt
 @RESPATH@/components/xpconnect.xpt
 @RESPATH@/components/xulapp.xpt
 @RESPATH@/components/xul.xpt
 @RESPATH@/components/xultmpl.xpt
 @RESPATH@/components/zipwriter.xpt
 
 ; JavaScript components
-@RESPATH@/components/ChromeNotifications.js
-@RESPATH@/components/ChromeNotifications.manifest
 @RESPATH@/components/ConsoleAPI.manifest
 @RESPATH@/components/ConsoleAPIStorage.js
 @RESPATH@/components/BrowserElementParent.manifest
 @RESPATH@/components/BrowserElementParent.js
 @RESPATH@/components/BrowserElementProxy.manifest
 @RESPATH@/components/BrowserElementProxy.js
 @RESPATH@/components/ContactManager.js
 @RESPATH@/components/ContactManager.manifest
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
@@ -340,18 +340,16 @@
 @RESPATH@/components/xpconnect.xpt
 @RESPATH@/components/xulapp.xpt
 @RESPATH@/components/xul.xpt
 @RESPATH@/components/xultmpl.xpt
 @RESPATH@/components/zipwriter.xpt
 @RESPATH@/components/telemetry.xpt
 
 ; JavaScript components
-@RESPATH@/components/ChromeNotifications.js
-@RESPATH@/components/ChromeNotifications.manifest
 @RESPATH@/components/ConsoleAPI.manifest
 @RESPATH@/components/ConsoleAPIStorage.js
 @RESPATH@/components/BrowserElementParent.manifest
 @RESPATH@/components/BrowserElementParent.js
 @RESPATH@/components/BrowserElementProxy.manifest
 @RESPATH@/components/BrowserElementProxy.js
 @RESPATH@/components/FeedProcessor.manifest
 @RESPATH@/components/FeedProcessor.js
--- a/dom/interfaces/notification/moz.build
+++ b/dom/interfaces/notification/moz.build
@@ -1,13 +1,12 @@
 # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 XPIDL_SOURCES += [
-    'nsIDOMDesktopNotification.idl',
     'nsINotificationStorage.idl',
 ]
 
 XPIDL_MODULE = 'dom_notification'
 
deleted file mode 100644
--- a/dom/interfaces/notification/nsIDOMDesktopNotification.idl
+++ /dev/null
@@ -1,20 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "domstubs.idl"
-
-interface nsIObserver;
-
-// Notification service that also provides the manifest URL
-[scriptable, uuid(50cb17d2-dc8a-4aa6-bcd3-94d76af14e20)]
-interface nsIAppNotificationService : nsISupports
-{
-    void showAppNotification(in AString  imageUrl,
-                             in AString  title,
-                             in AString  text,
-                             in nsIObserver alertListener,
-                             // details should be a WebIDL
-                             // AppNotificationServiceOptions Dictionary object
-                             in jsval    details);
-};
deleted file mode 100644
--- a/dom/notification/ChromeNotifications.js
+++ /dev/null
@@ -1,126 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-const DEBUG = false;
-
-function debug(s) {
-  dump("-*- ChromeNotifications.js: " + s + "\n");
-}
-
-const Ci = Components.interfaces;
-const Cu = Components.utils;
-
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "Services",
-                                  "resource://gre/modules/Services.jsm");
-
-XPCOMUtils.defineLazyServiceGetter(this, "cpmm",
-                                   "@mozilla.org/childprocessmessagemanager;1",
-                                   "nsIMessageSender");
-
-XPCOMUtils.defineLazyServiceGetter(this, "appNotifier",
-                                   "@mozilla.org/system-alerts-service;1",
-                                   "nsIAppNotificationService");
-
-const CHROMENOTIFICATIONS_CID = "{74f94093-8b37-497e-824f-c3b250a911da}";
-const CHROMENOTIFICATIONS_CONTRACTID = "@mozilla.org/mozChromeNotifications;1";
-
-function ChromeNotifications() {
-  this.innerWindowID = null;
-  this.resendCallback = null;
-}
-
-ChromeNotifications.prototype = {
-
-  init: function(aWindow) {
-    let util = aWindow.QueryInterface(Ci.nsIInterfaceRequestor)
-                      .getInterface(Ci.nsIDOMWindowUtils);
-    this.innerWindowID = util.currentInnerWindowID;
-    Services.obs.addObserver(this, "inner-window-destroyed", false);
-    cpmm.addMessageListener("Notification:GetAllCrossOrigin:Return:OK", this);
-  },
-
-  performResend: function(notifications) {
-    let resentNotifications = 0;
-
-    notifications.forEach(function(notification) {
-      let behavior;
-      try {
-        behavior = JSON.parse(notification.mozbehavior);
-      } catch(e) {
-        behavior = undefined;
-      }
-
-      if (behavior && behavior.showOnlyOnce === true) {
-        return;
-      }
-
-      appNotifier.showAppNotification(
-        notification.icon,
-        notification.title,
-        notification.body,
-        null,
-        {
-          manifestURL: notification.origin,
-          id: notification.alertName,
-          dir: notification.dir,
-          lang: notification.lang,
-          tag: notification.tag,
-          dbId: notification.id,
-          timestamp: notification.timestamp,
-          data: notification.data,
-          mozbehavior: behavior
-        }
-      );
-      resentNotifications++;
-    });
-
-    try {
-      this.resendCallback && this.resendCallback(resentNotifications);
-    } catch (ex) {
-      if (DEBUG) debug("Content sent exception: " + ex);
-    }
-  },
-
-  mozResendAllNotifications: function(resendCallback) {
-    this.resendCallback = resendCallback;
-    cpmm.sendAsyncMessage("Notification:GetAllCrossOrigin", {});
-  },
-
-  receiveMessage: function(message) {
-    switch (message.name) {
-      case "Notification:GetAllCrossOrigin:Return:OK":
-        this.performResend(message.data.notifications);
-        break;
-
-      default:
-        if (DEBUG) { debug("Unrecognized message: " + message.name); }
-        break;
-    }
-  },
-
-  observe: function(aSubject, aTopic, aData) {
-    if (DEBUG) debug("Topic: " + aTopic);
-    if (aTopic == "inner-window-destroyed") {
-      let wId = aSubject.QueryInterface(Ci.nsISupportsPRUint64).data;
-      if (wId != this.innerWindowID) {
-        return;
-      }
-      Services.obs.removeObserver(this, "inner-window-destroyed");
-      cpmm.removeMessageListener("Notification:GetAllCrossOrigin:Return:OK", this);
-    }
-  },
-
-  classID : Components.ID(CHROMENOTIFICATIONS_CID),
-  contractID : CHROMENOTIFICATIONS_CONTRACTID,
-  QueryInterface: XPCOMUtils.generateQI([Ci.nsIChromeNotifications,
-                                         Ci.nsIDOMGlobalPropertyInitializer,
-                                         Ci.nsIObserver,
-                                         Ci.nsIMessageListener]),
-};
-
-this.NSGetFactory = XPCOMUtils.generateNSGetFactory([ChromeNotifications]);
deleted file mode 100644
--- a/dom/notification/ChromeNotifications.manifest
+++ /dev/null
@@ -1,3 +0,0 @@
-# ChromeNotifications.js
-component {74f94093-8b37-497e-824f-c3b250a911da} ChromeNotifications.js
-contract @mozilla.org/mozChromeNotifications;1 {74f94093-8b37-497e-824f-c3b250a911da}
--- a/dom/notification/DesktopNotification.cpp
+++ b/dom/notification/DesktopNotification.cpp
@@ -6,17 +6,16 @@
 #include "mozilla/dom/DesktopNotification.h"
 #include "mozilla/dom/DesktopNotificationBinding.h"
 #include "mozilla/dom/AppNotificationServiceOptionsBinding.h"
 #include "mozilla/dom/ToJSValue.h"
 #include "nsComponentManagerUtils.h"
 #include "nsContentPermissionHelper.h"
 #include "nsXULAppAPI.h"
 #include "mozilla/dom/PBrowserChild.h"
-#include "nsIDOMDesktopNotification.h"
 #include "mozilla/Preferences.h"
 #include "nsGlobalWindow.h"
 #include "nsIScriptSecurityManager.h"
 #include "nsServiceManagerUtils.h"
 #include "PermissionMessageUtils.h"
 #include "nsILoadContext.h"
 
 namespace mozilla {
--- a/dom/notification/Notification.cpp
+++ b/dom/notification/Notification.cpp
@@ -50,20 +50,16 @@
 #include "nsThreadUtils.h"
 #include "nsToolkitCompsCID.h"
 #include "nsXULAppAPI.h"
 #include "ServiceWorkerManager.h"
 #include "WorkerPrivate.h"
 #include "WorkerRunnable.h"
 #include "WorkerScope.h"
 
-#ifdef MOZ_B2G
-#include "nsIDOMDesktopNotification.h"
-#endif
-
 namespace mozilla {
 namespace dom {
 
 using namespace workers;
 
 struct NotificationStrings
 {
   const nsString mID;
--- a/dom/notification/NotificationDB.jsm
+++ b/dom/notification/NotificationDB.jsm
@@ -30,18 +30,17 @@ XPCOMUtils.defineLazyServiceGetter(this,
 
 const NOTIFICATION_STORE_DIR = OS.Constants.Path.profileDir;
 const NOTIFICATION_STORE_PATH =
         OS.Path.join(NOTIFICATION_STORE_DIR, "notificationstore.json");
 
 const kMessages = [
   "Notification:Save",
   "Notification:Delete",
-  "Notification:GetAll",
-  "Notification:GetAllCrossOrigin"
+  "Notification:GetAll"
 ];
 
 var NotificationDB = {
 
   // Ensure we won't call init() while xpcom-shutdown is performed
   _shutdownInProgress: false,
 
   init: function() {
@@ -192,29 +191,16 @@ var NotificationDB = {
           returnMessage("Notification:GetAll:Return:KO", {
             requestID: message.data.requestID,
             origin: message.data.origin,
             errorMsg: error
           });
         });
         break;
 
-      case "Notification:GetAllCrossOrigin":
-        this.queueTask("getallaccrossorigin", message.data).then(
-          function(notifications) {
-            returnMessage("Notification:GetAllCrossOrigin:Return:OK", {
-              notifications: notifications
-            });
-          }).catch(function(error) {
-            returnMessage("Notification:GetAllCrossOrigin:Return:KO", {
-              errorMsg: error
-            });
-          });
-        break;
-
       case "Notification:Save":
         this.queueTask("save", message.data).then(function() {
           returnMessage("Notification:Save:Return:OK", {
             requestID: message.data.requestID
           });
         }).catch(function(error) {
           returnMessage("Notification:Save:Return:KO", {
             requestID: message.data.requestID,
@@ -281,20 +267,16 @@ var NotificationDB = {
     .then(function() {
       var task = this.runningTask;
 
       switch (task.operation) {
         case "getall":
           return this.taskGetAll(task.data);
           break;
 
-        case "getallaccrossorigin":
-          return this.taskGetAllCrossOrigin();
-          break;
-
         case "save":
           return this.taskSave(task.data);
           break;
 
         case "delete":
           return this.taskDelete(task.data);
           break;
       }
@@ -325,41 +307,16 @@ var NotificationDB = {
     if (this.notifications[origin]) {
       for (var i in this.notifications[origin]) {
         notifications.push(this.notifications[origin][i]);
       }
     }
     return Promise.resolve(notifications);
   },
 
-  taskGetAllCrossOrigin: function() {
-    if (DEBUG) { debug("Task, getting all whatever origin"); }
-    var notifications = [];
-    for (var origin in this.notifications) {
-      if (!this.notifications[origin]) {
-        continue;
-      }
-
-      for (var i in this.notifications[origin]) {
-        var notification = this.notifications[origin][i];
-
-        // Notifications without the alertName field cannot be resent by
-        // mozResendAllNotifications, so we just skip them. They will
-        // still be available to applications via Notification.get()
-        if (!('alertName' in notification)) {
-          continue;
-        }
-
-        notification.origin = origin;
-        notifications.push(notification);
-      }
-    }
-    return Promise.resolve(notifications);
-  },
-
   taskSave: function(data) {
     if (DEBUG) { debug("Task, saving"); }
     var origin = data.origin;
     var notification = data.notification;
     if (!this.notifications[origin]) {
       this.notifications[origin] = {};
       this.byTag[origin] = {};
     }
--- a/dom/notification/moz.build
+++ b/dom/notification/moz.build
@@ -1,17 +1,15 @@
 # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 EXTRA_COMPONENTS += [
-    'ChromeNotifications.js',
-    'ChromeNotifications.manifest',
     'NotificationStorage.js',
     'NotificationStorage.manifest',
 ]
 
 EXTRA_JS_MODULES += [
     'NotificationDB.jsm'
 ]
 
--- a/dom/tests/mochitest/notification/MockServices.js
+++ b/dom/tests/mochitest/notification/MockServices.js
@@ -56,35 +56,16 @@ var MockServices = (function () {
                                     cookie, alertListener, name) {
       this.showAlert({
         name: name,
         cookie: cookie,
         title: title
       }, alertListener);
     },
 
-    showAppNotification: function(aImageUrl, aTitle, aText, aAlertListener, aDetails) {
-      var listener = aAlertListener || (activeAlertNotifications[aDetails.id] ? activeAlertNotifications[aDetails.id].listener : undefined);
-      activeAppNotifications[aDetails.id] = {
-        observer: listener,
-        title: aTitle,
-        text: aText,
-        manifestURL: aDetails.manifestURL,
-        imageURL: aImageUrl,
-        lang: aDetails.lang || undefined,
-        id: aDetails.id || undefined,
-        dbId: aDetails.dbId || undefined,
-        dir: aDetails.dir || undefined,
-        tag: aDetails.tag || undefined,
-        timestamp: aDetails.timestamp || undefined,
-        data: aDetails.data || undefined
-      };
-      this.showAlertNotification(aImageUrl, aTitle, aText, true, "", listener, aDetails.id);
-    },
-
     closeAlert: function(name) {
       var alertNotification = activeAlertNotifications[name];
       if (alertNotification) {
         if (alertNotification.listener) {
           alertNotification.listener.observe(null, "alertfinished", alertNotification.cookie);
         }
         delete activeAlertNotifications[name];
       }
@@ -92,18 +73,17 @@ var MockServices = (function () {
       var appNotification = activeAppNotifications[name];
       if (appNotification) {
         delete activeAppNotifications[name];
       }
     },
 
     QueryInterface: function(aIID) {
       if (SpecialPowers.wrap(aIID).equals(SpecialPowers.Ci.nsISupports) ||
-          SpecialPowers.wrap(aIID).equals(SpecialPowers.Ci.nsIAlertsService) ||
-          SpecialPowers.wrap(aIID).equals(SpecialPowers.Ci.nsIAppNotificationService)) {
+          SpecialPowers.wrap(aIID).equals(SpecialPowers.Ci.nsIAlertsService)) {
         return this;
       }
       throw SpecialPowers.Components.results.NS_ERROR_NO_INTERFACE;
     },
 
     createInstance: function(aOuter, aIID) {
       if (aOuter != null) {
         throw SpecialPowers.Components.results.NS_ERROR_NO_AGGREGATION;
deleted file mode 100644
--- a/dom/tests/mochitest/notification/chrome.ini
+++ /dev/null
@@ -1,8 +0,0 @@
-[DEFAULT]
-skip-if = toolkit == 'android' # Bug 1287455: takes too long to complete on Android
-support-files =
-  MockServices.js
-  NotificationTest.js
-
-[test_notification_noresend.html]
-skip-if = (toolkit == 'gonk') # Mochitest on Gonk registers an app manifest that messes with the logic
--- a/dom/tests/mochitest/notification/desktop-notification/notification_common.js
+++ b/dom/tests/mochitest/notification/desktop-notification/notification_common.js
@@ -22,26 +22,19 @@ var mockAlertsService = {
   showAlertNotification: function(imageUrl, title, text, textClickable,
                                   cookie, alertListener, name, bidi,
                                   lang, data) {
     return this.showAlert({
       cookie: cookie
     }, alertListener);
   },
 
-  showAppNotification: function(imageUrl, title, text, alertListener, details) {
-    this.showAlertNotification(imageUrl, title, text, details.textClickable, "",
-                               alertListener, details.name, details.dir,
-                               details.lang, details.data);
-  },
-
   QueryInterface: function(aIID) {
     if (SpecialPowers.wrap(aIID).equals(SpecialPowers.Ci.nsISupports) ||
-        SpecialPowers.wrap(aIID).equals(SpecialPowers.Ci.nsIAlertsService) ||
-        SpecialPowers.wrap(aIID).equals(SpecialPowers.Ci.nsIAppNotificationService)) {
+        SpecialPowers.wrap(aIID).equals(SpecialPowers.Ci.nsIAlertsService)) {
       return this;
     }
     throw SpecialPowers.Components.results.NS_ERROR_NO_INTERFACE;
   },
 
   createInstance: function(aOuter, aIID) {
     if (aOuter != null) {
       throw SpecialPowers.Components.results.NS_ERROR_NO_AGGREGATION;
deleted file mode 100644
--- a/dom/tests/mochitest/notification/test_notification_noresend.html
+++ /dev/null
@@ -1,88 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-  <title>Testing mozResendAllNotifications() resend behavior for Pages</title>
-  <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-  <script type="text/javascript" src="MockServices.js"></script>
-  <script type="text/javascript" src="NotificationTest.js"></script>
-  <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" />
-</head>
-<body>
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1159128">Bug 1159128</a>
-<p id="display"></p>
-<div id="content" style="display: none"></div>
-<pre id="test"></pre>
-<script type="text/javascript">
-  var info = NotificationTest.info;
-  var notifications = [];
-
-  SimpleTest.requestFlakyTimeout("untriaged");
-
-  var steps = [
-    function (done) {
-      if (window.Notification) {
-        SpecialPowers.pushPrefEnv({"set": [
-          ["dom.ignore_webidl_scope_checks", true],
-          ]}, done);
-      } else {
-        ok(true, "Notifications are not enabled on the platform.");
-        done();
-      }
-    },
-
-    function (done) {
-      info("Test that we have mozChromeNotifications API");
-      ok(('mozChromeNotifications' in navigator), "should have mozChromeNotifications API");
-      ok(('mozResendAllNotifications' in navigator.mozChromeNotifications), "should have mozResendAllNotifications()");
-      done();
-    },
-
-    function (done) {
-      info("Making sure we have no previous notification pending");
-      var promise = Notification.get();
-      promise.then(function (notifications) {
-        is(notifications.length, 0, "notifications are all cleaned");
-        done();
-      });
-    },
-
-    // The notification is expected to be created and living properly
-    // so it will be accessible via Notification.get(), but NotificationStorage
-    // should not have sent it to NotificationDB.
-    function (done) {
-      info("Sending one notification");
-      var notif = new Notification("title");
-      ok(notif, "Notification object is valid");
-      notifications.push(notif);
-
-      var promise = Notification.get();
-      promise.then(function (notifications) {
-        is(notifications.length, 1, "one notification has been sent");
-        done();
-      });
-    },
-
-    // mozResendAllNotifications will poke directly NotificationDB, so we
-    // expect our notification to NOT have been put there and thus not being
-    // resent.
-    function (done) {
-      info("Trying to resend the notification");
-      var notif = notifications.pop();
-      notif.onclose = function() {
-        done();
-      };
-
-      navigator.mozChromeNotifications.mozResendAllNotifications(function(number) {
-        is(number, 0, "No notification resent");
-        notif.close();
-      });
-    }
-  ];
-
-  MockServices.register();
-  NotificationTest.run(steps, function () {
-    MockServices.unregister();
-  });
-</script>
-</body>
-</html>
--- a/dom/tests/moz.build
+++ b/dom/tests/moz.build
@@ -31,17 +31,16 @@ MOCHITEST_MANIFESTS += [
 ]
 
 MOCHITEST_CHROME_MANIFESTS += [
     'mochitest/beacon/chrome.ini',
     'mochitest/chrome/chrome.ini',
     'mochitest/general/chrome.ini',
     'mochitest/geolocation/chrome.ini',
     'mochitest/localstorage/chrome.ini',
-    'mochitest/notification/chrome.ini',
     'mochitest/sessionstorage/chrome.ini',
     'mochitest/whatwg/chrome.ini',
 ]
 
 if CONFIG['MOZ_GAMEPAD']:
     MOCHITEST_MANIFESTS += [
         'mochitest/gamepad/mochitest.ini',
     ]
deleted file mode 100644
--- a/dom/webidl/ChromeNotifications.webidl
+++ /dev/null
@@ -1,14 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-[JSImplementation="@mozilla.org/mozChromeNotifications;1",
- NavigatorProperty="mozChromeNotifications",
- ChromeOnly]
-interface ChromeNotifications {
-  void mozResendAllNotifications(ResendCallback resendCallback);
-};
-
-callback ResendCallback = void (long count);
--- a/dom/webidl/moz.build
+++ b/dom/webidl/moz.build
@@ -69,17 +69,16 @@ WEBIDL_FILES = [
     'CaretPosition.webidl',
     'CDATASection.webidl',
     'ChannelMergerNode.webidl',
     'ChannelSplitterNode.webidl',
     'CharacterData.webidl',
     'CheckerboardReportService.webidl',
     'ChildNode.webidl',
     'ChromeNodeList.webidl',
-    'ChromeNotifications.webidl',
     'ChromeUtils.webidl',
     'Client.webidl',
     'Clients.webidl',
     'ClipboardEvent.webidl',
     'CommandEvent.webidl',
     'Comment.webidl',
     'CompositionEvent.webidl',
     'Console.webidl',
--- a/mobile/android/installer/package-manifest.in
+++ b/mobile/android/installer/package-manifest.in
@@ -257,18 +257,16 @@
 @BINPATH@/components/xpcom_xpti.xpt
 @BINPATH@/components/xpconnect.xpt
 @BINPATH@/components/xulapp.xpt
 @BINPATH@/components/xul.xpt
 @BINPATH@/components/xultmpl.xpt
 @BINPATH@/components/zipwriter.xpt
 
 ; JavaScript components
-@BINPATH@/components/ChromeNotifications.js
-@BINPATH@/components/ChromeNotifications.manifest
 @BINPATH@/components/ConsoleAPI.manifest
 @BINPATH@/components/ConsoleAPIStorage.js
 @BINPATH@/components/ContactManager.js
 @BINPATH@/components/ContactManager.manifest
 @BINPATH@/components/PhoneNumberService.js
 @BINPATH@/components/PhoneNumberService.manifest
 @BINPATH@/components/NotificationStorage.js
 @BINPATH@/components/NotificationStorage.manifest