Bug 1530402 - Remove Fennec's {Browser,Page} Action implementation. r=snorp
☠☠ backed out by 61ebc1a22544 ☠ ☠
authorAgi Sferro <agi@sferro.dev>
Fri, 15 Nov 2019 16:37:06 +0000
changeset 502226 3d3366fe476fef1598d90b63133f151b6be5cdd3
parent 502225 7400c3fd2b5fade7e07e9fe12c6a8f531cfaf54a
child 502227 72274a5a821b2b8e3d9edaa9a0aaeba3e55de836
push id114172
push userdluca@mozilla.com
push dateTue, 19 Nov 2019 11:31:10 +0000
treeherdermozilla-inbound@b5c5ba07d3db [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssnorp
bugs1530402
milestone72.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1530402 - Remove Fennec's {Browser,Page} Action implementation. r=snorp We're going to replace this implementation from scratch so we remove it here to avoid a confusing diff. Differential Revision: https://phabricator.services.mozilla.com/D51917
mobile/android/components/extensions/ext-android.js
mobile/android/components/extensions/ext-browserAction.js
mobile/android/components/extensions/ext-pageAction.js
mobile/android/components/extensions/schemas/browser_action.json
mobile/android/components/extensions/schemas/jar.mn
mobile/android/components/extensions/schemas/page_action.json
mobile/android/components/extensions/test/mochitest/chrome.ini
mobile/android/components/extensions/test/mochitest/test_ext_activeTab_permission.html
mobile/android/components/extensions/test/mochitest/test_ext_browserAction_getPopup_setPopup.html
mobile/android/components/extensions/test/mochitest/test_ext_browserAction_getTitle_setTitle.html
mobile/android/components/extensions/test/mochitest/test_ext_browserAction_onClicked.html
mobile/android/components/extensions/test/mochitest/test_ext_pageAction_getPopup_setPopup.html
mobile/android/components/extensions/test/mochitest/test_ext_pageAction_show_hide.html
mobile/android/components/extensions/test/mochitest/test_ext_popup_behavior.html
mobile/android/components/extensions/test/mochitest/test_ext_tabs_query.html
mobile/android/modules/BrowserActions.jsm
mobile/android/modules/PageActions.jsm
mobile/android/modules/moz.build
--- a/mobile/android/components/extensions/ext-android.js
+++ b/mobile/android/components/extensions/ext-android.js
@@ -1,16 +1,10 @@
 "use strict";
 
-ChromeUtils.defineModuleGetter(
-  this,
-  "Services",
-  "resource://gre/modules/Services.jsm"
-);
-
 // This function is pretty tightly tied to Extension.jsm.
 // Its job is to fill in the |tab| property of the sender.
 const getSender = (extension, target, sender) => {
   let tabId = -1;
   if ("tabId" in sender) {
     // The message came from a privileged extension page running in a tab. In
     // that case, it should include a tabId property (which is filled in by the
     // page-open listener below).
@@ -71,44 +65,25 @@ global.openOptionsPage = extension => {
   } else {
     BrowserApp.openAddonManager({ addonId: extension.id });
   }
 
   return Promise.resolve();
 };
 
 extensions.registerModules({
-  browserAction: {
-    url: "chrome://geckoview/content/ext-browserAction.js",
-    schema: "chrome://geckoview/content/schemas/browser_action.json",
-    scopes: ["addon_parent"],
-    manifest: ["browser_action"],
-    paths: [["browserAction"]],
-  },
   browsingData: {
     url: "chrome://geckoview/content/ext-browsingData.js",
     schema: "chrome://geckoview/content/schemas/browsing_data.json",
     scopes: ["addon_parent"],
     manifest: ["browsing_data"],
     paths: [["browsingData"]],
   },
-  pageAction: {
-    url: "chrome://geckoview/content/ext-pageAction.js",
-    schema: "chrome://geckoview/content/schemas/page_action.json",
-    scopes: ["addon_parent"],
-    manifest: ["page_action"],
-    paths: [["pageAction"]],
-  },
   tabs: {
     url: "chrome://geckoview/content/ext-tabs.js",
     schema: "chrome://geckoview/content/schemas/tabs.json",
     scopes: ["addon_parent"],
     paths: [["tabs"]],
   },
+  geckoViewAddons: {
+    schema: "chrome://geckoview/content/schemas/gecko_view_addons.json",
+  },
 });
-
-if (!Services.androidBridge.isFennec) {
-  extensions.registerModules({
-    geckoViewAddons: {
-      schema: "chrome://geckoview/content/schemas/gecko_view_addons.json",
-    },
-  });
-}
deleted file mode 100644
--- a/mobile/android/components/extensions/ext-browserAction.js
+++ /dev/null
@@ -1,203 +0,0 @@
-/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set sts=2 sw=2 et tw=80: */
-"use strict";
-
-// The ext-* files are imported into the same scopes.
-/* import-globals-from ext-utils.js */
-
-// Import the android BrowserActions module.
-ChromeUtils.defineModuleGetter(
-  this,
-  "BrowserActions",
-  "resource://gre/modules/BrowserActions.jsm"
-);
-
-// WeakMap[Extension -> BrowserAction]
-let browserActionMap = new WeakMap();
-
-class BrowserAction extends EventEmitter {
-  constructor(options, extension) {
-    super();
-
-    this.uuid = `{${extension.uuid}}`;
-
-    this.defaults = {
-      name: options.default_title || extension.name,
-      popup: options.default_popup,
-    };
-
-    this.tabContext = new TabContext(tabId => this.defaults);
-
-    this.tabManager = extension.tabManager;
-
-    // eslint-disable-next-line mozilla/balanced-listeners
-    this.tabContext.on("tab-selected", (evt, tabId) => {
-      this.onTabSelected(tabId);
-    });
-    // eslint-disable-next-line mozilla/balanced-listeners
-    this.tabContext.on("tab-closed", (evt, tabId) => {
-      this.onTabClosed(tabId);
-    });
-
-    BrowserActions.register(this);
-  }
-
-  /**
-   * Required by the BrowserActions module. This event will get
-   * called whenever the browser action is clicked on.
-   */
-  onClicked() {
-    const tab = tabTracker.activeTab;
-
-    this.tabManager.addActiveTabPermission(tab);
-
-    let popup = this.tabContext.get(tab.id).popup || this.defaults.popup;
-    if (popup) {
-      tabTracker.openExtensionPopupTab(popup);
-    } else {
-      this.emit("click", tab);
-    }
-  }
-
-  /**
-   * Updates the browser action whenever a tab is selected.
-   * @param {string} tabId The tab id to update.
-   */
-  onTabSelected(tabId) {
-    let name = this.tabContext.get(tabId).name || this.defaults.name;
-    BrowserActions.update(this.uuid, { name });
-  }
-
-  /**
-   * Removes the tab from the property map now that it is closed.
-   * @param {string} tabId The tab id of the closed tab.
-   */
-  onTabClosed(tabId) {
-    this.tabContext.clear(tabId);
-  }
-
-  /**
-   * Sets a property for the browser action for the specified tab. If the property is set
-   * for the active tab, the browser action is also updated.
-   *
-   * @param {Object} tab The tab to set. If null, the browser action's default value is set.
-   * @param {string} prop The property to update. Currently only "name" is supported.
-   * @param {string} value The value to set the property to.
-   */
-  setProperty(tab, prop, value) {
-    if (tab == null) {
-      if (value) {
-        this.defaults[prop] = value;
-      }
-    } else {
-      let properties = this.tabContext.get(tab.id);
-      if (value) {
-        properties[prop] = value;
-      } else {
-        delete properties[prop];
-      }
-    }
-
-    if (!tab || tab.getActive()) {
-      BrowserActions.update(this.uuid, { [prop]: value });
-    }
-  }
-
-  /**
-   * Retreives a property of the browser action for the specified tab.
-   *
-   * @param {Object} tab The tab to retrieve the property from. If null, the default value is returned.
-   * @param {string} prop The property to retreive. Currently only "name" is supported.
-   * @returns {string} the value stored for the specified property. If the value is undefined, then the
-   *    default value is returned.
-   */
-  getProperty(tab, prop) {
-    if (tab == null) {
-      return this.defaults[prop];
-    }
-
-    return this.tabContext.get(tab.id)[prop] || this.defaults[prop];
-  }
-
-  /**
-   * Unregister the browser action from the BrowserActions module.
-   */
-  shutdown() {
-    this.tabContext.shutdown();
-    BrowserActions.unregister(this.uuid);
-  }
-}
-
-this.browserAction = class extends ExtensionAPI {
-  onManifestEntry(entryName) {
-    let { extension } = this;
-    let { manifest } = extension;
-
-    let browserAction = new BrowserAction(manifest.browser_action, extension);
-    browserActionMap.set(extension, browserAction);
-  }
-
-  onShutdown() {
-    let { extension } = this;
-
-    if (browserActionMap.has(extension)) {
-      browserActionMap.get(extension).shutdown();
-      browserActionMap.delete(extension);
-    }
-  }
-
-  getAPI(context) {
-    const { extension } = context;
-    const { tabManager } = extension;
-
-    function getTab(tabId) {
-      if (tabId !== null) {
-        return tabTracker.getTab(tabId);
-      }
-      return null;
-    }
-
-    return {
-      browserAction: {
-        onClicked: new EventManager({
-          context,
-          name: "browserAction.onClicked",
-          register: fire => {
-            let listener = (event, tab) => {
-              fire.async(tabManager.convert(tab));
-            };
-            browserActionMap.get(extension).on("click", listener);
-            return () => {
-              browserActionMap.get(extension).off("click", listener);
-            };
-          },
-        }).api(),
-
-        setTitle: function(details) {
-          let { tabId, title } = details;
-          let tab = getTab(tabId);
-          browserActionMap.get(extension).setProperty(tab, "name", title);
-        },
-
-        getTitle: function(details) {
-          let { tabId } = details;
-          let tab = getTab(tabId);
-          let title = browserActionMap.get(extension).getProperty(tab, "name");
-          return Promise.resolve(title);
-        },
-
-        setPopup(details) {
-          let tab = getTab(details.tabId);
-          let url = details.popup && context.uri.resolve(details.popup);
-          browserActionMap.get(extension).setProperty(tab, "popup", url);
-        },
-
-        getPopup(details) {
-          let tab = getTab(details.tabId);
-          let popup = browserActionMap.get(extension).getProperty(tab, "popup");
-          return Promise.resolve(popup);
-        },
-      },
-    };
-  }
-};
deleted file mode 100644
--- a/mobile/android/components/extensions/ext-pageAction.js
+++ /dev/null
@@ -1,292 +0,0 @@
-/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set sts=2 sw=2 et tw=80: */
-
-"use strict";
-
-// The ext-* files are imported into the same scopes.
-/* import-globals-from ext-utils.js */
-
-ChromeUtils.defineModuleGetter(
-  this,
-  "Services",
-  "resource://gre/modules/Services.jsm"
-);
-
-// Import the android PageActions module.
-ChromeUtils.defineModuleGetter(
-  this,
-  "PageActions",
-  "resource://gre/modules/PageActions.jsm"
-);
-
-var { ExtensionParent } = ChromeUtils.import(
-  "resource://gre/modules/ExtensionParent.jsm"
-);
-
-var { IconDetails } = ExtensionParent;
-
-// WeakMap[Extension -> PageAction]
-let pageActionMap = new WeakMap();
-
-class PageAction extends EventEmitter {
-  constructor(manifest, extension) {
-    super();
-
-    this.id = null;
-
-    this.extension = extension;
-
-    this.defaults = {
-      icons: IconDetails.normalize({ path: manifest.default_icon }, extension),
-      popup: manifest.default_popup,
-    };
-
-    this.tabManager = extension.tabManager;
-    this.context = null;
-
-    this.tabContext = new TabContext(tabId => this.defaults);
-
-    this.options = {
-      title: manifest.default_title || extension.name,
-      id: `{${extension.uuid}}`,
-      clickCallback: () => {
-        let tab = tabTracker.activeTab;
-
-        this.tabManager.addActiveTabPermission(tab);
-
-        let popup = this.tabContext.get(tab.id).popup || this.defaults.popup;
-        if (popup) {
-          tabTracker.openExtensionPopupTab(popup);
-        } else {
-          this.emit("click", tab);
-        }
-      },
-    };
-
-    this.shouldShow = false;
-
-    // eslint-disable-next-line mozilla/balanced-listeners
-    this.tabContext.on("tab-selected", (evt, tabId) => {
-      this.onTabSelected(tabId);
-    });
-    // eslint-disable-next-line mozilla/balanced-listeners
-    this.tabContext.on("tab-closed", (evt, tabId) => {
-      this.onTabClosed(tabId);
-    });
-  }
-
-  /**
-   * Updates the page action whenever a tab is selected.
-   * @param {Integer} tabId The ID of the selected tab.
-   */
-  onTabSelected(tabId) {
-    if (this.options.icon) {
-      this.hide();
-      let shouldShow = this.tabContext.get(tabId).show;
-      if (shouldShow) {
-        this.show();
-      }
-    }
-  }
-
-  /**
-   * Removes the tab from the property map now that it is closed.
-   * @param {Integer} tabId The ID of the closed tab.
-   */
-  onTabClosed(tabId) {
-    this.tabContext.clear(tabId);
-  }
-
-  /**
-   * Sets the context for the page action.
-   * @param {Object} context The extension context.
-   */
-  setContext(context) {
-    this.context = context;
-  }
-
-  /**
-   * Sets a property for the page action for the specified tab. If the property is set
-   * for the active tab, the page action is also updated.
-   *
-   * @param {Object} tab The tab to set.
-   * @param {string} prop The property to update - either "show" or "popup".
-   * @param {string} value The value to set the property to. If falsy, the property is deleted.
-   * @returns {Object} Promise which resolves when the property is set and the page action is
-   *    shown if necessary.
-   */
-  setProperty(tab, prop, value) {
-    if (tab == null) {
-      throw new Error("Tab must not be null");
-    }
-
-    let properties = this.tabContext.get(tab.id);
-    if (value) {
-      properties[prop] = value;
-    } else {
-      delete properties[prop];
-    }
-
-    if (prop === "show" && tab.id == tabTracker.activeTab.id) {
-      if (this.id && !value) {
-        return this.hide();
-      } else if (!this.id && value) {
-        return this.show();
-      }
-    }
-  }
-
-  /**
-   * Retreives a property of the page action for the specified tab.
-   *
-   * @param {Object} tab The tab to retrieve the property from. If null, the default value is returned.
-   * @param {string} prop The property to retreive - currently only "popup" is supported.
-   * @returns {string} the value stored for the specified property. If the value for the tab is undefined, then the
-   *    default value is returned.
-   */
-  getProperty(tab, prop) {
-    if (tab == null) {
-      return this.defaults[prop];
-    }
-
-    return this.tabContext.get(tab.id)[prop] || this.defaults[prop];
-  }
-
-  /**
-   * Show the page action for the active tab.
-   * @returns {Promise} resolves when the page action is shown.
-   */
-  show() {
-    // The PageAction icon has been created or it is being converted.
-    if (this.id || this.shouldShow) {
-      return Promise.resolve();
-    }
-
-    if (this.options.icon) {
-      this.id = PageActions.add(this.options);
-      return Promise.resolve();
-    }
-
-    this.shouldShow = true;
-
-    // Bug 1372782: Remove dependency on contentWindow from this file. It should
-    // be put in a separate file called ext-c-pageAction.js.
-    // Note: Fennec is not going to be multi-process for the foreseaable future,
-    // so this layering violation has no immediate impact. However, it is should
-    // be done at some point.
-    let { contentWindow } = this.context.xulBrowser;
-
-    // Bug 1372783: Why is this contentWindow.devicePixelRatio, while
-    // convertImageURLToDataURL uses browserWindow.devicePixelRatio?
-    let { icon } = IconDetails.getPreferredIcon(
-      this.defaults.icons,
-      this.extension,
-      16 * contentWindow.devicePixelRatio
-    );
-
-    let browserWindow = Services.wm.getMostRecentWindow("navigator:browser");
-    return IconDetails.convertImageURLToDataURL(
-      icon,
-      contentWindow,
-      browserWindow
-    )
-      .then(dataURI => {
-        if (this.shouldShow) {
-          this.options.icon = dataURI;
-          this.id = PageActions.add(this.options);
-        }
-      })
-      .catch(() => {
-        // The "icon conversion" promise has been rejected, set `this.shouldShow` to `false`
-        // so that we will try again on the next `pageAction.show` call.
-        this.shouldShow = false;
-
-        return Promise.reject({
-          message: "Failed to load PageAction icon",
-        });
-      });
-  }
-
-  /**
-   * Hides the page action for the active tab.
-   */
-  hide() {
-    this.shouldShow = false;
-
-    if (this.id) {
-      PageActions.remove(this.id);
-      this.id = null;
-    }
-  }
-
-  shutdown() {
-    this.tabContext.shutdown();
-    this.hide();
-  }
-}
-
-this.pageAction = class extends ExtensionAPI {
-  onManifestEntry(entryName) {
-    let { extension } = this;
-    let { manifest } = extension;
-
-    let pageAction = new PageAction(manifest.page_action, extension);
-    pageActionMap.set(extension, pageAction);
-  }
-
-  onShutdown() {
-    let { extension } = this;
-
-    if (pageActionMap.has(extension)) {
-      pageActionMap.get(extension).shutdown();
-      pageActionMap.delete(extension);
-    }
-  }
-
-  getAPI(context) {
-    const { extension } = context;
-    const { tabManager } = extension;
-
-    pageActionMap.get(extension).setContext(context);
-
-    return {
-      pageAction: {
-        onClicked: new EventManager({
-          context,
-          name: "pageAction.onClicked",
-          register: fire => {
-            let listener = (event, tab) => {
-              fire.async(tabManager.convert(tab));
-            };
-            pageActionMap.get(extension).on("click", listener);
-            return () => {
-              pageActionMap.get(extension).off("click", listener);
-            };
-          },
-        }).api(),
-
-        show(tabId) {
-          let tab = tabTracker.getTab(tabId);
-          return pageActionMap.get(extension).setProperty(tab, "show", true);
-        },
-
-        hide(tabId) {
-          let tab = tabTracker.getTab(tabId);
-          pageActionMap.get(extension).setProperty(tab, "show", false);
-        },
-
-        setPopup(details) {
-          let tab = tabTracker.getTab(details.tabId);
-          let url = details.popup && context.uri.resolve(details.popup);
-          pageActionMap.get(extension).setProperty(tab, "popup", url);
-        },
-
-        getPopup(details) {
-          let tab = tabTracker.getTab(details.tabId);
-          let popup = pageActionMap.get(extension).getProperty(tab, "popup");
-          return Promise.resolve(popup);
-        },
-      },
-    };
-  }
-};
deleted file mode 100644
--- a/mobile/android/components/extensions/schemas/browser_action.json
+++ /dev/null
@@ -1,448 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-[
-  {
-    "namespace": "manifest",
-    "types": [
-      {
-        "$extend": "WebExtensionManifest",
-        "properties": {
-          "browser_action": {
-            "type": "object",
-            "additionalProperties": { "$ref": "UnrecognizedProperty" },
-            "properties": {
-              "default_title": {
-                "type": "string",
-                "optional": true,
-                "preprocess": "localize"
-              },
-              "default_icon": {
-                "$ref": "IconPath",
-                "deprecated": "Unsupported on Android.",
-                "optional": true
-              },
-              "default_popup": {
-                "type": "string",
-                "format": "relativeUrl",
-                "optional": true,
-                "preprocess": "localize"
-              },
-              "browser_style": {
-                "type": "boolean",
-                "deprecated": "Unsupported on Android.",
-                "optional": true,
-                "default": false
-              },
-              "default_area": {
-                "description": "Defines the location the browserAction will appear by default.  The default location is navbar.",
-                "type": "string",
-                "enum": ["navbar", "menupanel", "tabstrip", "personaltoolbar"],
-                "deprecated": "Unsupported on Android.",
-                "optional": true
-              }
-            },
-            "optional": true
-          }
-        }
-      }
-    ]
-  },
-  {
-    "namespace": "browserAction",
-    "description": "Use browser actions to put icons in the main browser toolbar, to the right of the address bar. In addition to its icon, a browser action can also have a tooltip, a badge, and a popup.",
-    "permissions": ["manifest:browser_action"],
-    "types": [
-      {
-        "id": "ColorArray",
-        "type": "array",
-        "items": {
-          "type": "integer",
-          "minimum": 0,
-          "maximum": 255
-        },
-        "minItems": 4,
-        "maxItems": 4
-      },
-      {
-        "id": "ImageDataType",
-        "type": "object",
-        "isInstanceOf": "ImageData",
-        "additionalProperties": { "type": "any" },
-        "postprocess": "convertImageDataToURL",
-        "description": "Pixel data for an image. Must be an ImageData object (for example, from a <code>canvas</code> element)."
-      }
-    ],
-    "functions": [
-      {
-        "name": "setTitle",
-        "type": "function",
-        "description": "Sets the title of the browser action. This shows up in the tooltip.",
-        "async": "callback",
-        "parameters": [
-          {
-            "name": "details",
-            "type": "object",
-            "properties": {
-              "title": {
-                "type": "string",
-                "description": "The string the browser action should display when moused over."
-              },
-              "tabId": {
-                "type": "integer",
-                "optional": true,
-                "description": "Limits the change to when a particular tab is selected. Automatically resets when the tab is closed."
-              }
-            }
-          },
-          {
-            "type": "function",
-            "name": "callback",
-            "optional": true,
-            "parameters": []
-          }
-        ]
-      },
-      {
-        "name": "getTitle",
-        "type": "function",
-        "description": "Gets the title of the browser action.",
-        "async": "callback",
-        "parameters": [
-          {
-            "name": "details",
-            "type": "object",
-            "properties": {
-              "tabId": {
-                "type": "integer",
-                "optional": true,
-                "description": "Specify the tab to get the title from. If no tab is specified, the non-tab-specific title is returned."
-              }
-            }
-          },
-          {
-            "type": "function",
-            "name": "callback",
-            "parameters": [
-              {
-                "name": "result",
-                "type": "string"
-              }
-            ]
-          }
-        ]
-      },
-      {
-        "name": "setIcon",
-        "unsupported": true,
-        "type": "function",
-        "description": "Sets the icon for the browser action. The icon can be specified either as the path to an image file or as the pixel data from a canvas element, or as dictionary of either one of those. Either the <b>path</b> or the <b>imageData</b> property must be specified.",
-        "async": "callback",
-        "parameters": [
-          {
-            "name": "details",
-            "type": "object",
-            "properties": {
-              "imageData": {
-                "choices": [
-                  { "$ref": "ImageDataType" },
-                  {
-                    "type": "object",
-                    "additionalProperties": {"$ref": "ImageDataType"}
-                  }
-                ],
-                "optional": true,
-                "description": "Either an ImageData object or a dictionary {size -> ImageData} representing icon to be set. If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. If the number of image pixels that fit into one screen space unit equals <code>scale</code>, then image with size <code>scale</code> * 19 will be selected. Initially only scales 1 and 2 will be supported. At least one image must be specified. Note that 'details.imageData = foo' is equivalent to 'details.imageData = {'19': foo}'"
-              },
-              "path": {
-                "choices": [
-                  { "type": "string" },
-                  {
-                    "type": "object",
-                    "additionalProperties": {"type": "string"}
-                  }
-                ],
-                "optional": true,
-                "description": "Either a relative image path or a dictionary {size -> relative image path} pointing to icon to be set. If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. If the number of image pixels that fit into one screen space unit equals <code>scale</code>, then image with size <code>scale</code> * 19 will be selected. Initially only scales 1 and 2 will be supported. At least one image must be specified. Note that 'details.path = foo' is equivalent to 'details.imageData = {'19': foo}'"
-              },
-              "tabId": {
-                "type": "integer",
-                "optional": true,
-                "description": "Limits the change to when a particular tab is selected. Automatically resets when the tab is closed."
-              }
-            }
-          },
-          {
-            "type": "function",
-            "name": "callback",
-            "optional": true,
-            "parameters": []
-          }
-        ]
-      },
-      {
-        "name": "setPopup",
-        "type": "function",
-        "description": "Sets the html document to be opened as a popup when the user clicks on the browser action's icon.",
-        "async": "callback",
-        "parameters": [
-          {
-            "name": "details",
-            "type": "object",
-            "properties": {
-              "tabId": {
-                "type": "integer",
-                "optional": true,
-                "minimum": 0,
-                "description": "Limits the change to when a particular tab is selected. Automatically resets when the tab is closed."
-              },
-              "popup": {
-                "type": "string",
-                "description": "The html file to show in a popup.  If set to the empty string (''), no popup is shown."
-              }
-            }
-          },
-          {
-            "type": "function",
-            "name": "callback",
-            "optional": true,
-            "parameters": []
-          }
-        ]
-      },
-      {
-        "name": "getPopup",
-        "type": "function",
-        "description": "Gets the html document set as the popup for this browser action.",
-        "async": "callback",
-        "parameters": [
-          {
-            "name": "details",
-            "type": "object",
-            "properties": {
-              "tabId": {
-                "type": "integer",
-                "optional": true,
-                "minimum": 0,
-                "description": "Specify the tab to get the popup from. If no tab is specified, the non-tab-specific popup is returned."
-              }
-            }
-          },
-          {
-            "type": "function",
-            "name": "callback",
-            "parameters": [
-              {
-                "name": "result",
-                "type": "string"
-              }
-            ]
-          }
-        ]
-      },
-      {
-        "name": "setBadgeText",
-        "unsupported": true,
-        "type": "function",
-        "description": "Sets the badge text for the browser action. The badge is displayed on top of the icon.",
-        "async": "callback",
-        "parameters": [
-          {
-            "name": "details",
-            "type": "object",
-            "properties": {
-              "text": {
-                "type": "string",
-                "description": "Any number of characters can be passed, but only about four can fit in the space."
-              },
-              "tabId": {
-                "type": "integer",
-                "optional": true,
-                "description": "Limits the change to when a particular tab is selected. Automatically resets when the tab is closed."
-              }
-            }
-          },
-          {
-            "type": "function",
-            "name": "callback",
-            "optional": true,
-            "parameters": []
-          }
-        ]
-      },
-      {
-        "name": "getBadgeText",
-        "unsupported": true,
-        "type": "function",
-        "description": "Gets the badge text of the browser action. If no tab is specified, the non-tab-specific badge text is returned.",
-        "async": "callback",
-        "parameters": [
-          {
-            "name": "details",
-            "type": "object",
-            "properties": {
-              "tabId": {
-                "type": "integer",
-                "optional": true,
-                "description": "Specify the tab to get the badge text from. If no tab is specified, the non-tab-specific badge text is returned."
-              }
-            }
-          },
-          {
-            "type": "function",
-            "name": "callback",
-            "parameters": [
-              {
-                "name": "result",
-                "type": "string"
-              }
-            ]
-          }
-        ]
-      },
-      {
-        "name": "setBadgeBackgroundColor",
-        "unsupported": true,
-        "type": "function",
-        "description": "Sets the background color for the badge.",
-        "async": "callback",
-        "parameters": [
-          {
-            "name": "details",
-            "type": "object",
-            "properties": {
-              "color": {
-                "description": "An array of four integers in the range [0,255] that make up the RGBA color of the badge. For example, opaque red is <code>[255, 0, 0, 255]</code>. Can also be a string with a CSS value, with opaque red being <code>#FF0000</code> or <code>#F00</code>.",
-                "choices": [
-                  {"type": "string"},
-                  {"$ref": "ColorArray"}
-                ]
-              },
-              "tabId": {
-                "type": "integer",
-                "optional": true,
-                "description": "Limits the change to when a particular tab is selected. Automatically resets when the tab is closed."
-              }
-            }
-          },
-          {
-            "type": "function",
-            "name": "callback",
-            "optional": true,
-            "parameters": []
-          }
-        ]
-      },
-      {
-        "name": "getBadgeBackgroundColor",
-        "unsupported": true,
-        "type": "function",
-        "description": "Gets the background color of the browser action.",
-        "async": "callback",
-        "parameters": [
-          {
-            "name": "details",
-            "type": "object",
-            "properties": {
-              "tabId": {
-                "type": "integer",
-                "optional": true,
-                "description": "Specify the tab to get the badge background color from. If no tab is specified, the non-tab-specific badge background color is returned."
-              }
-            }
-          },
-          {
-            "type": "function",
-            "name": "callback",
-            "parameters": [
-              {
-                "name": "result",
-                "$ref": "ColorArray"
-              }
-            ]
-          }
-        ]
-      },
-      {
-        "name": "enable",
-        "unsupported": true,
-        "type": "function",
-        "description": "Enables the browser action for a tab. By default, browser actions are enabled.",
-        "async": "callback",
-        "parameters": [
-          {
-            "type": "integer",
-            "optional": true,
-            "name": "tabId",
-            "minimum": 0,
-            "description": "The id of the tab for which you want to modify the browser action."
-          },
-          {
-            "type": "function",
-            "name": "callback",
-            "optional": true,
-            "parameters": []
-          }
-        ]
-      },
-      {
-        "name": "disable",
-        "unsupported": true,
-        "type": "function",
-        "description": "Disables the browser action for a tab.",
-        "async": "callback",
-        "parameters": [
-          {
-            "type": "integer",
-            "optional": true,
-            "name": "tabId",
-            "minimum": 0,
-            "description": "The id of the tab for which you want to modify the browser action."
-          },
-          {
-            "type": "function",
-            "name": "callback",
-            "optional": true,
-            "parameters": []
-          }
-        ]
-      },
-      {
-        "name": "openPopup",
-        "unsupported": true,
-        "type": "function",
-        "description": "Opens the extension popup window in the active window but does not grant tab permissions.",
-        "async": "callback",
-        "parameters": [
-          {
-            "type": "function",
-            "name": "callback",
-            "parameters": [
-              {
-                "name": "popupView",
-                "type": "object",
-                "optional": true,
-                "description": "JavaScript 'window' object for the popup window if it was succesfully opened.",
-                "additionalProperties": { "type": "any" }
-              }
-            ]
-          }
-        ]
-      }
-    ],
-    "events": [
-      {
-        "name": "onClicked",
-        "type": "function",
-        "description": "Fired when a browser action icon is clicked.  This event will not fire if the browser action has a popup.",
-        "parameters": [
-          {
-            "name": "tab",
-            "$ref": "tabs.Tab"
-          }
-        ]
-      }
-    ]
-  }
-]
--- a/mobile/android/components/extensions/schemas/jar.mn
+++ b/mobile/android/components/extensions/schemas/jar.mn
@@ -1,10 +1,8 @@
 # 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/.
 
 geckoview.jar:
-    content/schemas/browser_action.json
     content/schemas/browsing_data.json
     content/schemas/gecko_view_addons.json
-    content/schemas/page_action.json
     content/schemas/tabs.json
deleted file mode 100644
--- a/mobile/android/components/extensions/schemas/page_action.json
+++ /dev/null
@@ -1,240 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-[
-  {
-    "namespace": "manifest",
-    "types": [
-      {
-        "$extend": "WebExtensionManifest",
-        "properties": {
-          "page_action": {
-            "type": "object",
-            "additionalProperties": { "$ref": "UnrecognizedProperty" },
-            "properties": {
-              "default_title": {
-                "type": "string",
-                "optional": true,
-                "preprocess": "localize"
-              },
-              "default_icon": {
-                "$ref": "IconPath",
-                "optional": true
-              },
-              "default_popup": {
-                "type": "string",
-                "format": "relativeUrl",
-                "optional": true,
-                "preprocess": "localize"
-              },
-              "browser_style": {
-                "type": "boolean",
-                "optional": true,
-                "default": false
-              }
-            },
-            "optional": true
-          }
-        }
-      }
-    ]
-  },
-  {
-    "namespace": "pageAction",
-    "description": "Use the <code>browser.pageAction</code> API to put icons inside the address bar. Page actions represent actions that can be taken on the current page, but that aren't applicable to all pages.",
-    "permissions": ["manifest:page_action"],
-    "types": [
-      {
-        "id": "ImageDataType",
-        "type": "object",
-        "isInstanceOf": "ImageData",
-        "additionalProperties": { "type": "any" },
-        "description": "Pixel data for an image. Must be an ImageData object (for example, from a <code>canvas</code> element)."
-      }
-    ],
-    "functions": [
-      {
-        "name": "show",
-        "type": "function",
-        "description": "Shows the page action. The page action is shown whenever the tab is selected.",
-        "async": "callback",
-        "parameters": [
-          {"type": "integer", "name": "tabId", "minimum": 0, "description": "The id of the tab for which you want to modify the page action."},
-          {
-            "type": "function",
-            "name": "callback",
-            "optional": true,
-            "parameters": []
-          }
-        ]
-      },
-      {
-        "name": "hide",
-        "type": "function",
-        "description": "Hides the page action.",
-        "async": "callback",
-        "parameters": [
-          {"type": "integer", "name": "tabId", "minimum": 0, "description": "The id of the tab for which you want to modify the page action."},
-          {
-            "type": "function",
-            "name": "callback",
-            "optional": true,
-            "parameters": []
-          }
-        ]
-      },
-      {
-        "name": "setTitle",
-        "unsupported": true,
-        "type": "function",
-        "description": "Sets the title of the page action. This is displayed in a tooltip over the page action.",
-        "parameters": [
-          {
-            "name": "details",
-            "type": "object",
-            "properties": {
-              "tabId": {"type": "integer", "minimum": 0, "description": "The id of the tab for which you want to modify the page action."},
-              "title": {"type": "string", "description": "The tooltip string."}
-            }
-          }
-        ]
-      },
-      {
-        "name": "getTitle",
-        "unsupported": true,
-        "type": "function",
-        "description": "Gets the title of the page action.",
-        "async": "callback",
-        "parameters": [
-          {
-            "name": "details",
-            "type": "object",
-            "properties": {
-              "tabId": {
-                "type": "integer",
-                "description": "Specify the tab to get the title from."
-              }
-            }
-          },
-          {
-            "type": "function",
-            "name": "callback",
-            "parameters": [
-              {
-                "name": "result",
-                "type": "string"
-              }
-            ]
-          }
-        ]
-      },
-      {
-        "name": "setIcon",
-        "unsupported": true,
-        "type": "function",
-        "description": "Sets the icon for the page action. The icon can be specified either as the path to an image file or as the pixel data from a canvas element, or as dictionary of either one of those. Either the <b>path</b> or the <b>imageData</b> property must be specified.",
-        "async": "callback",
-        "parameters": [
-          {
-            "name": "details",
-            "type": "object",
-            "properties": {
-              "tabId": {"type": "integer", "minimum": 0, "description": "The id of the tab for which you want to modify the page action."},
-              "imageData": {
-                "choices": [
-                  { "$ref": "ImageDataType" },
-                  {
-                    "type": "object",
-                    "additionalProperties": {"$ref": "ImageDataType"}
-                  }
-                ],
-                "optional": true,
-                "description": "Either an ImageData object or a dictionary {size -> ImageData} representing icon to be set. If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. If the number of image pixels that fit into one screen space unit equals <code>scale</code>, then image with size <code>scale</code> * 19 will be selected. Initially only scales 1 and 2 will be supported. At least one image must be specified. Note that 'details.imageData = foo' is equivalent to 'details.imageData = {'19': foo}'"
-              },
-              "path": {
-                "choices": [
-                  { "type": "string" },
-                  {
-                    "type": "object",
-                    "additionalProperties": {"type": "string"}
-                  }
-                ],
-                "optional": true,
-                "description": "Either a relative image path or a dictionary {size -> relative image path} pointing to icon to be set. If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. If the number of image pixels that fit into one screen space unit equals <code>scale</code>, then image with size <code>scale</code> * 19 will be selected. Initially only scales 1 and 2 will be supported. At least one image must be specified. Note that 'details.path = foo' is equivalent to 'details.imageData = {'19': foo}'"
-              }
-            }
-          },
-          {
-            "type": "function",
-            "name": "callback",
-            "optional": true,
-            "parameters": []
-          }
-        ]
-      },
-      {
-        "name": "setPopup",
-        "type": "function",
-        "async": "callback",
-        "description": "Sets the html document to be opened as a popup when the user clicks on the page action's icon.",
-        "parameters": [
-          {
-            "name": "details",
-            "type": "object",
-            "properties": {
-              "tabId": {"type": "integer", "minimum": 0, "description": "The id of the tab for which you want to modify the page action."},
-              "popup": {
-                "type": "string",
-                "description": "The html file to show in a popup.  If set to the empty string (''), no popup is shown."
-              }
-            }
-          },
-          {
-            "type": "function",
-            "name": "callback",
-            "optional": true,
-            "parameters": []
-          }
-        ]
-      },
-      {
-        "name": "getPopup",
-        "type": "function",
-        "description": "Gets the html document set as the popup for this page action.",
-        "async": "callback",
-        "parameters": [
-          {
-            "name": "details",
-            "type": "object",
-            "properties": {
-              "tabId": {
-                "type": "integer",
-                "description": "Specify the tab to get the popup from."
-              }
-            }
-          },
-          {
-            "type": "function",
-            "name": "callback",
-            "optional": true,
-            "parameters": []
-          }
-        ]
-      }
-    ],
-    "events": [
-      {
-        "name": "onClicked",
-        "type": "function",
-        "description": "Fired when a page action icon is clicked.  This event will not fire if the page action has a popup.",
-        "parameters": [
-          {
-            "name": "tab",
-            "$ref": "tabs.Tab"
-          }
-        ]
-      }
-    ]
-  }
-]
--- a/mobile/android/components/extensions/test/mochitest/chrome.ini
+++ b/mobile/android/components/extensions/test/mochitest/chrome.ini
@@ -1,19 +1,11 @@
 [DEFAULT]
 support-files =
   head.js
   ../../../../../../toolkit/components/extensions/test/mochitest/chrome_cleanup_script.js
 tags = webextensions
 
-[test_ext_activeTab_permission.html]
-[test_ext_browserAction_getPopup_setPopup.html]
-[test_ext_browserAction_getTitle_setTitle.html]
-[test_ext_browserAction_onClicked.html]
 [test_ext_browsingData_cookies_cache.html]
 [test_ext_browsingData_downloads.html]
 [test_ext_browsingData_formdata.html]
 [test_ext_browsingData_settings.html]
 [test_ext_options_ui.html]
-[test_ext_pageAction_show_hide.html]
-[test_ext_pageAction_getPopup_setPopup.html]
-[test_ext_popup_behavior.html]
-skip-if = (os == "android" && !debug) #Bug 1463383 - timeout
deleted file mode 100644
--- a/mobile/android/components/extensions/test/mochitest/test_ext_activeTab_permission.html
+++ /dev/null
@@ -1,469 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-  <title>PageAction Test</title>
-  <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-  <script src="chrome://mochikit/content/tests/SimpleTest/ExtensionTestUtils.js"></script>
-  <script type="text/javascript" src="head.js"></script>
-  <link rel="stylesheet" href="chrome://mochikit/contents/tests/SimpleTest/test.css"/>
-</head>
-<body>
-
-<script type="text/javascript">
-"use strict";
-
-var {BrowserActions} = SpecialPowers.Cu.import("resource://gre/modules/BrowserActions.jsm", {});
-var {PageActions} = SpecialPowers.Cu.import("resource://gre/modules/PageActions.jsm", {});
-var {Services} = SpecialPowers.Cu.import("resource://gre/modules/Services.jsm", {});
-
-function pageLoadedContentScript() {
-  browser.test.sendMessage("page-loaded", window.location.href);
-}
-
-add_task(async function test_activeTab_pageAction() {
-  async function background() {
-    function contentScriptCode() {
-      browser.test.log("content script executed");
-
-      return "tabs.executeScript result";
-    }
-
-    const createdTab = await browser.tabs.create({
-      url: "http://example.com/#test_activeTab_pageAction",
-    });
-
-    browser.test.log(`Created new tab with id: ${createdTab.id}`);
-
-    await browser.pageAction.show(createdTab.id);
-
-    browser.pageAction.onClicked.addListener(async (tab) => {
-      browser.test.assertEq(createdTab.id, tab.id,
-                            "pageAction clicked on the expected tab id");
-
-      const [result] = await browser.tabs.executeScript(tab.id, {
-        code: `(${contentScriptCode})()`,
-      }).catch(error => {
-        // Make the test to fail fast if something goes wrong.
-        browser.test.fail(`Unexpected exception on tabs.executeScript: ${error}`);
-        browser.tabs.remove(tab.id);
-        browser.test.notifyFail("page_action.activeTab.done");
-        throw error;
-      });
-
-      browser.test.assertEq("tabs.executeScript result", result,
-                            "Got the expected result from tabs.executeScript");
-
-      browser.tabs.onRemoved.addListener((tabId) => {
-        if (tabId !== tab.id) {
-          return;
-        }
-
-        browser.test.notifyPass("page_action.activeTab.done");
-      });
-      browser.tabs.remove(tab.id);
-    });
-
-    browser.test.sendMessage("background_page.ready");
-  }
-
-  let extension = ExtensionTestUtils.loadExtension({
-    background,
-    manifest: {
-      "name": "PageAction Extension",
-      "page_action": {
-        "default_title": "Page Action",
-        "default_icon": {
-          "18": "extension.png",
-        },
-      },
-      "content_scripts": [
-        {
-          "js": ["page_loaded.js"],
-          "matches": ["http://example.com/*"],
-          "run_at": "document_end",
-        },
-      ],
-      "permissions": ["activeTab"],
-    },
-    files: {
-      "extension.png": TEST_ICON_ARRAYBUFFER,
-      "page_loaded.js": pageLoadedContentScript,
-    },
-  });
-
-  await extension.startup();
-
-  await extension.awaitMessage("background_page.ready");
-
-  const uuid = `{${extension.uuid}}`;
-
-  ok(PageActions.isShown(uuid), "page action is shown");
-
-  info("Wait the new tab to be loaded");
-  const loadedURL = await extension.awaitMessage("page-loaded");
-
-  is(loadedURL, "http://example.com/#test_activeTab_pageAction",
-     "The expected URL has been loaded in a new tab");
-
-  info("Click the pageAction");
-  PageActions.synthesizeClick(uuid);
-
-  await extension.awaitFinish("page_action.activeTab.done");
-
-  await extension.unload();
-});
-
-add_task(async function test_activeTab_browserAction() {
-  async function background() {
-    let createdTab;
-
-    function contentScriptCode() {
-      browser.test.log("content script executed");
-
-      return "tabs.executeScript result";
-    }
-
-    browser.browserAction.onClicked.addListener(async (tab) => {
-      browser.test.assertEq(createdTab.id, tab.id,
-                            "browserAction clicked on the expected tab id");
-
-      const [result] = await browser.tabs.executeScript(tab.id, {
-        code: `(${contentScriptCode})()`,
-      }).catch(error => {
-        // Make the test to fail fast if something goes wrong.
-        browser.test.fail(`Unexpected exception on tabs.executeScript: ${error}`);
-        browser.tabs.remove(tab.id);
-        browser.test.notifyFail("browser_action.activeTab.done");
-        throw error;
-      });
-
-      browser.test.assertEq("tabs.executeScript result", result,
-                            "Got the expected result from tabs.executeScript");
-
-      browser.tabs.onRemoved.addListener((tabId) => {
-        if (tabId !== tab.id) {
-          return;
-        }
-
-        browser.test.notifyPass("browser_action.activeTab.done");
-      });
-      browser.tabs.remove(tab.id);
-    });
-
-    createdTab = await browser.tabs.create({
-      url: "http://example.com/#test_activeTab_browserAction",
-    });
-
-    browser.test.log(`Created a new tab with id: ${createdTab.id}`);
-
-    browser.test.sendMessage("background_page.ready");
-  }
-
-  let extension = ExtensionTestUtils.loadExtension({
-    background,
-    manifest: {
-      "name": "BrowserAction Extension",
-      "browser_action": {
-        "default_title": "Browser Action",
-      },
-      "content_scripts": [
-        {
-          "js": ["page_loaded.js"],
-          "matches": ["http://example.com/*"],
-          "run_at": "document_end",
-        },
-      ],
-      "permissions": ["activeTab"],
-    },
-    files: {
-      "page_loaded.js": pageLoadedContentScript,
-    },
-  });
-
-  await extension.startup();
-
-  await extension.awaitMessage("background_page.ready");
-
-  const uuid = `{${extension.uuid}}`;
-
-  ok(BrowserActions.isShown(uuid), "browser action is shown");
-
-  info("Wait the new tab to be loaded");
-  const loadedURL = await extension.awaitMessage("page-loaded");
-
-  is(loadedURL, "http://example.com/#test_activeTab_browserAction",
-     "The expected URL has been loaded in a new tab");
-
-  info("Click the browserAction");
-  BrowserActions.synthesizeClick(uuid);
-
-  await extension.awaitFinish("browser_action.activeTab.done");
-
-  await extension.unload();
-});
-
-add_task(async function test_activeTab_pageAction_popup() {
-  async function background() {
-    await browser.tabs.create({url: "http://example.com#test_activeTab_pageAction_popup"});
-    const tabs = await browser.tabs.query({active: true});
-    await browser.pageAction.show(tabs[0].id);
-
-    browser.test.log(`pageAction shown on tab ${tabs[0].id}`);
-
-    browser.test.sendMessage("background_page.ready", {activeTabId: tabs[0].id});
-  }
-
-  async function popupScript() {
-    function contentScriptCode() {
-      browser.test.log("content script executed");
-
-      return "tabs.executeScript result";
-    }
-
-    const tabs = await browser.tabs.query({active: true});
-    const tab = tabs[0];
-
-    browser.test.log(`extension popup tab opened loaded for activeTab ${tab.id}`);
-
-    browser.test.sendMessage("extension_popup.activeTab", tab.id);
-
-    const [result] = await browser.tabs.executeScript(tab.id, {
-      code: `(${contentScriptCode})()`,
-    }).catch(error => {
-      // Make the test to fail fast if something goes wrong.
-      browser.test.fail(`Unexpected exception on tabs.executeScript: ${error}`);
-      browser.test.notifyFail("page_action_popup.activeTab.done");
-      throw error;
-    });
-
-    browser.test.assertEq("tabs.executeScript result", result,
-                          "Got the expected result from tabs.executeScript");
-
-    browser.test.notifyPass("page_action_popup.activeTab.done");
-  }
-
-  let popupHtml = `<!DOCTYPE html>
-    <html>
-      <head>
-        <meta charset="utf-8">
-      </head>
-      <body>
-        <h1>Extension Popup</h1>
-        <script src="popup.js"><\/script>
-      </body>
-    </html>
-  `;
-
-  let extension = ExtensionTestUtils.loadExtension({
-    background,
-    manifest: {
-      "name": "PageAction Extension",
-      "page_action": {
-        "default_title": "Page Action",
-        "default_icon": {
-          "18": "extension.png",
-        },
-        "default_popup": "popup.html",
-      },
-      "content_scripts": [
-        {
-          "js": ["page_loaded.js"],
-          "matches": ["http://example.com/*"],
-          "run_at": "document_end",
-        },
-      ],
-      "permissions": ["activeTab"],
-    },
-    files: {
-      "extension.png": TEST_ICON_ARRAYBUFFER,
-      "page_loaded.js": pageLoadedContentScript,
-      "popup.html": popupHtml,
-      "popup.js": popupScript,
-    },
-  });
-
-  await extension.startup();
-
-  const {activeTabId} = await extension.awaitMessage("background_page.ready");
-
-  const uuid = `{${extension.uuid}}`;
-
-  ok(PageActions.isShown(uuid), "page action is shown");
-
-  info("Wait the new tab to be loaded");
-  const loadedURL = await extension.awaitMessage("page-loaded");
-
-  is(loadedURL, "http://example.com/#test_activeTab_pageAction_popup",
-     "The expected URL has been loaded in a new tab");
-
-  PageActions.synthesizeClick(uuid);
-
-  const popupActiveTabId = await extension.awaitMessage("extension_popup.activeTab");
-
-  // Check that while the extension popup tab is selected the active tab is still the tab
-  // from which the user has opened the extension popup.
-  is(popupActiveTabId, activeTabId,
-     "Got the expected tabId while the extension popup tab was selected");
-
-  await extension.awaitFinish("page_action_popup.activeTab.done");
-
-  const chromeWin = Services.wm.getMostRecentWindow("navigator:browser");
-  const BrowserApp = chromeWin.BrowserApp;
-
-  const popupTab = BrowserApp.selectedTab;
-  const popupTabId = popupTab.id;
-
-  let onceTabClosed = new Promise(resolve => {
-    BrowserApp.deck.addEventListener("TabClose", () => setTimeout(resolve, 0), {once: true});
-  });
-
-  // Switch to the parent tab of the popup tab.
-  // (which should make the extension popup tab to be closed automatically)
-  BrowserApp.selectTab(BrowserApp.getTabForId(popupTab.parentId));
-
-  info("Wait for the extension popup tab to be closed once the parent tab has been selected");
-
-  await onceTabClosed;
-
-  is(BrowserApp.getTabForId(popupTabId), null,
-     "The extension popup tab should have been closed");
-
-  // Close the tab that opened the extension popup before exiting the test.
-  BrowserApp.closeTab(BrowserApp.selectedTab);
-
-  await extension.unload();
-});
-
-add_task(async function test_activeTab_browserAction_popup() {
-  async function background() {
-    await browser.tabs.create({url: "http://example.com#test_activeTab_browserAction_popup"});
-    const tabs = await browser.tabs.query({active: true});
-
-    browser.test.sendMessage("background_page.ready", {activeTabId: tabs[0].id});
-  }
-
-  async function popupScript() {
-    function contentScriptCode() {
-      browser.test.log("content script executed");
-
-      return "tabs.executeScript result";
-    }
-
-    const tabs = await browser.tabs.query({active: true});
-    const tab = tabs[0];
-
-    browser.test.log(`extension popup tab opened loaded for activeTab ${tab.id}`);
-
-    browser.test.sendMessage("extension_popup.activeTab", tab.id);
-
-    const [result] = await browser.tabs.executeScript(tab.id, {
-      code: `(${contentScriptCode})()`,
-    }).catch(error => {
-      // Make the test to fail fast if something goes wrong.
-      browser.test.fail(`Unexpected exception on tabs.executeScript: ${error}`);
-      browser.test.notifyFail("browser_action_popup.activeTab.done");
-      throw error;
-    });
-
-    browser.test.assertEq("tabs.executeScript result", result,
-                          "Got the expected result from tabs.executeScript");
-
-    browser.test.notifyPass("browser_action_popup.activeTab.done");
-  }
-
-  let popupHtml = `<!DOCTYPE html>
-    <html>
-      <head>
-        <meta charset="utf-8">
-      </head>
-      <body>
-        <h1>Extension Popup</h1>
-        <script src="popup.js"><\/script>
-      </body>
-    </html>
-  `;
-
-  let extension = ExtensionTestUtils.loadExtension({
-    background,
-    manifest: {
-      "name": "BrowserAction Extension",
-      "browser_action": {
-        "default_title": "Browser Action",
-        "default_icon": {
-          "18": "extension.png",
-        },
-        "default_popup": "popup.html",
-      },
-      "content_scripts": [
-        {
-          "js": ["page_loaded.js"],
-          "matches": ["http://example.com/*"],
-          "run_at": "document_end",
-        },
-      ],
-      "permissions": ["activeTab"],
-    },
-    files: {
-      "extension.png": TEST_ICON_ARRAYBUFFER,
-      "page_loaded.js": pageLoadedContentScript,
-      "popup.html": popupHtml,
-      "popup.js": popupScript,
-    },
-  });
-
-  await extension.startup();
-
-  const {activeTabId} = await extension.awaitMessage("background_page.ready");
-
-  const uuid = `{${extension.uuid}}`;
-
-  ok(BrowserActions.isShown(uuid), "browser action is shown");
-
-  info("Wait the new tab to be loaded");
-  const loadedURL = await extension.awaitMessage("page-loaded");
-
-  is(loadedURL, "http://example.com/#test_activeTab_browserAction_popup",
-     "The expected URL has been loaded in a new tab");
-
-  BrowserActions.synthesizeClick(uuid);
-
-  const popupActiveTabId = await extension.awaitMessage("extension_popup.activeTab");
-
-  // Check that while the extension popup tab is selected the active tab is still the tab
-  // from which the user has opened the extension popup.
-  is(popupActiveTabId, activeTabId,
-     "Got the expected tabId while the extension popup tab was selected");
-
-  await extension.awaitFinish("browser_action_popup.activeTab.done");
-
-  const chromeWin = Services.wm.getMostRecentWindow("navigator:browser");
-  const BrowserApp = chromeWin.BrowserApp;
-
-  const popupTab = BrowserApp.selectedTab;
-  const popupTabId = popupTab.id;
-
-  let onceTabClosed = new Promise(resolve => {
-    BrowserApp.deck.addEventListener("TabClose", () => setTimeout(resolve, 0), {once: true});
-  });
-
-  // Switch to the parent tab of the popup tab.
-  // (which should make the extension popup tab to be closed automatically)
-  BrowserApp.selectTab(BrowserApp.getTabForId(popupTab.parentId));
-
-  info("Wait for the extension popup tab to be closed once the parent tab has been selected");
-
-  await onceTabClosed;
-
-  is(BrowserApp.getTabForId(popupTabId), null,
-     "The extension popup tab should have been closed");
-
-  // Close the tab that opened the extension popup before exiting the test.
-  BrowserApp.closeTab(BrowserApp.selectedTab);
-
-  await extension.unload();
-});
-
-</script>
-
-</body>
-</html>
deleted file mode 100644
--- a/mobile/android/components/extensions/test/mochitest/test_ext_browserAction_getPopup_setPopup.html
+++ /dev/null
@@ -1,191 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-  <title>BrowserAction Test</title>
-  <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-  <script src="chrome://mochikit/content/tests/SimpleTest/ExtensionTestUtils.js"></script>
-  <script type="text/javascript" src="head.js"></script>
-  <link rel="stylesheet" href="chrome://mochikit/contents/tests/SimpleTest/test.css"/>
-</head>
-<body>
-
-<script type="text/javascript">
-"use strict";
-
-var {BrowserActions} = SpecialPowers.Cu.import("resource://gre/modules/BrowserActions.jsm", {});
-var {ContentTaskUtils} = SpecialPowers.Cu.import("resource://testing-common/ContentTaskUtils.jsm", {});
-var {Services} = SpecialPowers.Cu.import("resource://gre/modules/Services.jsm", {});
-
-function createPopupHTML({text, js}) {
-  return `<!DOCTYPE html>
-    <html>
-      <head>
-        <meta charset="utf-8">
-        <title>${text}</title>
-      </head>
-      <body>
-        <h1>${text}</h1>
-        <script src="${js}"><\/script>
-      </body>
-    </html>
-  `;
-}
-
-async function ensureTabSelected(nativeTab) {
-  const {BrowserApp} = Services.wm.getMostRecentWindow("navigator:browser");
-
-  BrowserApp.selectTab(nativeTab);
-
-  await ContentTaskUtils.waitForCondition(() => {
-    return nativeTab.getActive();
-  });
-}
-
-add_task(async function test_browserAction_setPopup_and_getPopup() {
-  const DEFAULT_POPUP = "/default_popup.html";
-  const CUSTOM_POPUP_1 = "/custom_popup_1.html";
-  const CUSTOM_POPUP_2 = "/custom_popup_2.html";
-
-  const {BrowserApp} = Services.wm.getMostRecentWindow("navigator:browser");
-  const initialTab = BrowserApp.selectedTab;
-
-  const tab1 = BrowserApp.addTab("about:blank#tab1", {parentId: initialTab.id});
-  const tab2 = BrowserApp.addTab("about:blank#tab2", {parentId: initialTab.id});
-  const tab3 = BrowserApp.addTab("about:blank#tab3", {parentId: initialTab.id});
-
-  function background() {
-    async function handleBrowserActionSetPopup({tabId, popup}) {
-      await browser.browserAction.setPopup({tabId, popup});
-
-      browser.test.sendMessage("browserAction-setPopup:done", {tabId, popup});
-    }
-
-    async function handleBrowserActionGetPopup({tabId}) {
-      const popup = await browser.browserAction.getPopup({tabId});
-
-      const popupURL = new URL(popup);
-
-      browser.test.sendMessage("browserAction-getPopup:done", {
-        tabId,
-        popup: popupURL.pathname,
-      });
-    }
-
-    browser.test.onMessage.addListener((msg, args) => {
-      switch (msg) {
-        case "browserAction-setPopup":
-          handleBrowserActionSetPopup(args);
-          break;
-        case "browserAction-getPopup":
-          handleBrowserActionGetPopup(args);
-          break;
-        default:
-          browser.test.fail(`Unexpected test message received: ${msg}`);
-      }
-    });
-
-    browser.test.sendMessage("background-ready");
-  }
-
-  function popupScript() {
-    browser.test.sendMessage("popup-loaded", {popup: window.location.pathname});
-
-    window.close();
-  }
-
-  const extension = ExtensionTestUtils.loadExtension({
-    background,
-    manifest: {
-      "browser_action": {
-        "default_popup": "default_popup.html",
-        "default_title": "BrowserAction title",
-      },
-    },
-    files: {
-      "default_popup.html": createPopupHTML({text: "Default Popup", js: "popup.js"}),
-      "custom_popup_1.html": createPopupHTML({text: "Custom Popup 1", js: "popup.js"}),
-      "custom_popup_2.html": createPopupHTML({text: "Custom Popup 2", js: "popup.js"}),
-      "popup.js": popupScript,
-    },
-  });
-
-  await extension.startup();
-
-  const uuid = `{${extension.uuid}}`;
-
-  await extension.awaitMessage("background-ready");
-
-  // Test that the browserAction popup is currently the default popup for all the opened tabs.
-
-  for (const tab of [tab1, tab2, tab3]) {
-    extension.sendMessage("browserAction-getPopup", {tabId: tab.id});
-
-    const res = await extension.awaitMessage("browserAction-getPopup:done");
-
-    isDeeply(res, {tabId: tab.id, popup: DEFAULT_POPUP},
-             "All the tabs should have been associated the same default browserAction popup");
-  }
-
-  // Customize the popup for the first two tabs and checks that getPopup return the expected popup.
-
-  extension.sendMessage("browserAction-setPopup", {
-    tabId: tab1.id,
-    popup: CUSTOM_POPUP_1,
-  });
-
-  await extension.awaitMessage("browserAction-setPopup:done");
-
-  extension.sendMessage("browserAction-setPopup", {
-    tabId: tab2.id,
-    popup: CUSTOM_POPUP_2,
-  });
-
-  await extension.awaitMessage("browserAction-setPopup:done");
-
-  extension.sendMessage("browserAction-getPopup", {tabId: tab1.id});
-  const resTab1 = await extension.awaitMessage("browserAction-getPopup:done");
-  isDeeply(resTab1, {tabId: tab1.id, popup: CUSTOM_POPUP_1},
-           "The first tab should have been associated to the custom  popup 1");
-
-  extension.sendMessage("browserAction-getPopup", {tabId: tab2.id});
-  const resTab2 = await extension.awaitMessage("browserAction-getPopup:done");
-  isDeeply(resTab2, {tabId: tab2.id, popup: CUSTOM_POPUP_2},
-           "The second tab should have been associated to the custom popup 2");
-
-  extension.sendMessage("browserAction-getPopup", {tabId: tab3.id});
-  const resTab3 = await extension.awaitMessage("browserAction-getPopup:done");
-  isDeeply(resTab3, {tabId: tab3.id, popup: DEFAULT_POPUP},
-           "The third tab should still be associated to the default popup");
-
-  // Test browserAction popup opened by clicking on the browserAction.
-
-  await ensureTabSelected(tab1);
-  BrowserActions.synthesizeClick(uuid);
-  const popupLoadedTab1 = await extension.awaitMessage("popup-loaded");
-  isDeeply(popupLoadedTab1, {popup: CUSTOM_POPUP_1},
-           "The expected custom popup has been opened for the first tab");
-
-  await ensureTabSelected(tab2);
-  BrowserActions.synthesizeClick(uuid);
-  const popupLoadedTab2 = await extension.awaitMessage("popup-loaded");
-  isDeeply(popupLoadedTab2, {popup: CUSTOM_POPUP_2},
-           "The expected custom popup has been opened for the second tab");
-
-  await ensureTabSelected(tab3);
-  BrowserActions.synthesizeClick(uuid);
-  const popupLoadedTab3 = await extension.awaitMessage("popup-loaded");
-  isDeeply(popupLoadedTab3, {popup: DEFAULT_POPUP},
-           "The expected default popup has been opened for the third tab");
-
-  // Cleanup the browser before exiting.
-
-  BrowserApp.closeTab(tab1);
-  BrowserApp.closeTab(tab2);
-  BrowserApp.closeTab(tab3);
-
-  await extension.unload();
-});
-</script>
-
-</body>
-</html>
deleted file mode 100644
--- a/mobile/android/components/extensions/test/mochitest/test_ext_browserAction_getTitle_setTitle.html
+++ /dev/null
@@ -1,164 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-  <title>BrowserAction Test</title>
-  <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-  <script src="chrome://mochikit/content/tests/SimpleTest/ExtensionTestUtils.js"></script>
-  <script type="text/javascript" src="head.js"></script>
-  <link rel="stylesheet" href="chrome://mochikit/contents/tests/SimpleTest/test.css"/>
-</head>
-<body>
-
-<script type="text/javascript">
-"use strict";
-
-var {BrowserActions} = SpecialPowers.Cu.import("resource://gre/modules/BrowserActions.jsm", {});
-var {ContentTaskUtils} = SpecialPowers.Cu.import("resource://testing-common/ContentTaskUtils.jsm", {});
-
-add_task(async function test_setTitle_and_getTitle() {
-  async function background() {
-    let tabCreatedPromise = new Promise(resolve => {
-      let onTabCreated = tab => {
-        browser.tabs.onCreated.removeListener(onTabCreated);
-        resolve();
-      };
-      browser.tabs.onCreated.addListener(onTabCreated);
-    });
-
-    async function createAndTestNewTab(title, url) {
-      // First make sure the default title is correct.
-      let defaultTitle = await browser.browserAction.getTitle({});
-      browser.test.assertEq("Browser Action", defaultTitle, "Expected the default title to be returned");
-
-      // Create a tab.
-      let [tab] = await Promise.all([
-        browser.tabs.create({url}),
-        tabCreatedPromise,
-      ]);
-
-      // Test that the default title is returned before the title is set for the tab.
-      let tabTitle = await browser.browserAction.getTitle({tabId: tab.id});
-      browser.test.assertEq("Browser Action", tabTitle, "Expected the default title to be returned");
-
-      // Set the title for the new tab and test that getTitle returns the correct title.
-      await browser.browserAction.setTitle({tabId: tab.id, title});
-      tabTitle = await browser.browserAction.getTitle({tabId: tab.id});
-      browser.test.assertEq(title, tabTitle, "Expected the new tab title to be returned");
-
-      return tab;
-    }
-
-    // Create and test 3 new tabs.
-    let tab1 = await createAndTestNewTab("tab 1", "about:blank");
-    let tab2 = await createAndTestNewTab("tab 2", "about:blank");
-    let tab3 = await createAndTestNewTab("tab 3", "about:blank");
-
-    // Test the default title again.
-    let title = await browser.browserAction.getTitle({});
-    browser.test.assertEq("Browser Action", title, "Expected the default title to be returned");
-
-    // Update the default title and confirm that the new title is returned.
-    await browser.browserAction.setTitle({title: "Updated Title"});
-    title = await browser.browserAction.getTitle({});
-    browser.test.assertEq("Updated Title", title, "Expected the default title to be updated");
-
-    // Try setting the default title to an empty string and confirm that the original title is still used.
-    browser.browserAction.setTitle({title: ""});
-    title = await browser.browserAction.getTitle({});
-    browser.test.assertEq("Updated Title", title, "Expected the default title to be returned");
-
-    // Check all of the created tabs now.
-    title = await browser.browserAction.getTitle({tabId: tab1.id});
-    browser.test.assertEq("tab 1", title, "Expected the first tab title");
-    title = await browser.browserAction.getTitle({tabId: tab2.id});
-    browser.test.assertEq("tab 2", title, "Expected the second tab title");
-    title = await browser.browserAction.getTitle({tabId: tab3.id});
-    browser.test.assertEq("tab 3", title, "Expected the third tab title");
-
-    // Unset the title for the first tab and confirm that it is unset.
-    browser.browserAction.setTitle({tabId: tab1.id, title: ""});
-    title = await browser.browserAction.getTitle({tabId: tab1.id});
-    browser.test.assertEq("Updated Title", title, `Expected the default title to be returned`);
-
-    browser.test.onMessage.addListener(async (msg, data) => {
-      if (msg === "select-tab") {
-        await browser.tabs.update(data, {active: true});
-        browser.test.sendMessage("tab-selected");
-      } else if (msg == "finish") {
-        // Close the tabs
-        await browser.tabs.remove([tab1.id, tab2.id, tab3.id]);
-        browser.test.notifyPass("browserAction.setTitleAndGetTitle");
-      }
-    });
-
-    browser.test.sendMessage("tabs", {tab1, tab2, tab3});
-  }
-
-  const extension = ExtensionTestUtils.loadExtension({
-    background,
-    manifest: {
-      "name": name,
-      "browser_action": {
-        "default_title": "Browser Action",
-      },
-    },
-  });
-
-  await extension.startup();
-
-  let tabs = await extension.awaitMessage("tabs");
-
-  async function checkTab(tab, name) {
-    extension.sendMessage("select-tab", tab.id);
-    await extension.awaitMessage("tab-selected");
-    // Wait until the browser action has updated to the correct title.
-    await ContentTaskUtils.waitForCondition(() => {
-      return BrowserActions.getNameForActiveTab(`{${extension.uuid}}`) === name;
-    });
-  }
-
-  await checkTab(tabs.tab1, "Updated Title");
-  await checkTab(tabs.tab2, "tab 2");
-  await checkTab(tabs.tab3, "tab 3");
-  await checkTab(tabs.tab1, "Updated Title");
-
-  extension.sendMessage("finish");
-  await extension.awaitFinish("browserAction.setTitleAndGetTitle");
-
-  await extension.unload();
-});
-
-add_task(async function test_setTitle_activeTab() {
-  async function background() {
-    const tabs = await browser.tabs.query({active: true});
-    const tabId = tabs[0].id;
-
-    const title = "Customized browserAction title";
-    await browser.browserAction.setTitle({tabId, title});
-
-    browser.test.notifyPass("browserAction_setTitle_activeTab.done");
-  }
-
-  const extension = ExtensionTestUtils.loadExtension({
-    background,
-    manifest: {
-      "browser_action": {
-        "default_title": "Browser Action default title",
-      },
-    },
-  });
-
-  await extension.startup();
-
-  await extension.awaitFinish("browserAction_setTitle_activeTab.done");
-
-  is(BrowserActions.getNameForActiveTab(`{${extension.uuid}}`),
-     "Customized browserAction title",
-     "The browserAction title has been updated on the currently activeTab");
-
-  await extension.unload();
-});
-</script>
-
-</body>
-</html>
deleted file mode 100644
--- a/mobile/android/components/extensions/test/mochitest/test_ext_browserAction_onClicked.html
+++ /dev/null
@@ -1,93 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-  <title>BrowserAction Test</title>
-  <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-  <script src="chrome://mochikit/content/tests/SimpleTest/ExtensionTestUtils.js"></script>
-  <script type="text/javascript" src="head.js"></script>
-  <link rel="stylesheet" href="chrome://mochikit/contents/tests/SimpleTest/test.css"/>
-</head>
-<body>
-
-<script type="text/javascript">
-"use strict";
-
-var {BrowserActions} = SpecialPowers.Cu.import("resource://gre/modules/BrowserActions.jsm", {});
-
-async function background() {
-  browser.test.assertTrue("browserAction" in browser, "Namespace 'browserAction' exists in browser");
-  browser.test.assertTrue("onClicked" in browser.browserAction, "API method 'onClicked' exists in browser.browserAction");
-
-  const tabs = await browser.tabs.query({active: true, currentWindow: true});
-
-  browser.browserAction.onClicked.addListener(tab => {
-    browser.test.sendMessage("browser-action-clicked", tab);
-  });
-
-  browser.test.sendMessage("ready", tabs[0]);
-}
-
-function createExtension(name) {
-  return ExtensionTestUtils.loadExtension({
-    background,
-    manifest: {
-      "name": name,
-      "browser_action": {
-        "default_title": "Browser Action",
-      },
-    },
-  });
-}
-
-function* checkBrowserAction(extension, id, tab) {
-  ok(BrowserActions.isShown(id), "The BrowerAction should be shown");
-  BrowserActions.synthesizeClick(id);
-  const clickedTab = yield extension.awaitMessage("browser-action-clicked");
-  is(clickedTab.id, tab.id, "Got the expected tab id in the browserAction.onClicked event");
-}
-
-add_task(async function test_browserAction() {
-  const extension = createExtension("BrowserAction Extension");
-  await extension.startup();
-  const tab = await extension.awaitMessage("ready");
-  let id = `{${extension.uuid}}`;
-  await checkBrowserAction(extension, id, tab);
-  await extension.unload();
-
-  ok(!BrowserActions.isShown(id), "The BrowserAction should be removed after the extension unloads");
-});
-
-add_task(async function test_multiple_browserActions() {
-  const ext1 = createExtension("BrowserAction Extension 1");
-  const ext2 = createExtension("BrowserAction Extension 2");
-
-  // Start the first extension and test its browser action.
-  await ext1.startup();
-  const tab1 = await ext1.awaitMessage("ready");
-  let id1 = `{${ext1.uuid}}`;
-  await checkBrowserAction(ext1, id1, tab1);
-
-  // Start the second extension and test its browser action.
-  await ext2.startup();
-  const tab2 = await ext2.awaitMessage("ready");
-  let id2 = `{${ext2.uuid}}`;
-  await checkBrowserAction(ext2, id2, tab2);
-
-  // Verify that the first browser action is still active.
-  await checkBrowserAction(ext1, id1, tab1);
-
-  // Unload the first extension and verify that the browser action is removed.
-  await ext1.unload();
-  ok(!BrowserActions.isShown(id1), "The first BrowserAction should be removed after ext1 unloads");
-
-  // Verify that the second browser action is still active.
-  await checkBrowserAction(ext2, id2, tab2);
-
-  // Unload the second extension and verify that the browser action is removed.
-  await ext2.unload();
-  ok(!BrowserActions.isShown(id2), "The second BrowserAction should be removed after ext2 unloads");
-});
-</script>
-
-</body>
-</html>
deleted file mode 100644
--- a/mobile/android/components/extensions/test/mochitest/test_ext_pageAction_getPopup_setPopup.html
+++ /dev/null
@@ -1,218 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-  <title>PageAction Test</title>
-  <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-  <script src="chrome://mochikit/content/tests/SimpleTest/ExtensionTestUtils.js"></script>
-  <script type="text/javascript" src="head.js"></script>
-  <link rel="stylesheet" href="chrome://mochikit/contents/tests/SimpleTest/test.css"/>
-</head>
-<body>
-
-<script type="text/javascript">
-"use strict";
-
-const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
-
-var {PageActions} = ChromeUtils.import("resource://gre/modules/PageActions.jsm");
-
-add_task(async function test_setPopup_and_getPopup() {
-  async function background() {
-    let tabCreatedPromise = new Promise(resolve => {
-      let onTabCreated = tab => {
-        browser.tabs.onCreated.removeListener(onTabCreated);
-        resolve();
-      };
-      browser.tabs.onCreated.addListener(onTabCreated);
-    });
-
-    async function createAndTestNewTab(expectedPopup, url) {
-      // Create a tab.
-      let [, tab] = await Promise.all([
-        tabCreatedPromise,
-        browser.tabs.create({url}),
-      ]);
-
-      // Test that the default popup is returned before the popup is set for the tab.
-      let defaultPopup = await browser.pageAction.getPopup({tabId: tab.id});
-      browser.test.assertTrue(defaultPopup.includes("default.html"), "Expected the default popup to be returned");
-
-      // Set the title for the new tab and test that getTitle returns the correct title.
-      await browser.pageAction.setPopup({tabId: tab.id, popup: expectedPopup});
-      let actualPopup = await browser.pageAction.getPopup({tabId: tab.id});
-      browser.test.assertTrue(actualPopup.includes(expectedPopup), "Expected the new tab popup to be returned");
-
-      return tab;
-    }
-
-    // Create and test 2 new tabs.
-    let tab1 = await createAndTestNewTab("a.html", "about:blank");
-    let tab2 = await createAndTestNewTab("b.html", "about:blank");
-
-    // Check all of the created tabs now.
-    let popup = await browser.pageAction.getPopup({tabId: tab1.id});
-    browser.test.assertTrue(popup.includes("a.html"), "Expected the first tab popup");
-    popup = await browser.pageAction.getPopup({tabId: tab2.id});
-    browser.test.assertTrue(popup.includes("b.html"), "Expected the second tab popup");
-
-    // Unset the popup for the first tab and confirm that it is unset.
-    browser.pageAction.setPopup({tabId: tab1.id, popup: ""});
-    popup = await browser.pageAction.getPopup({tabId: tab1.id});
-    browser.test.assertTrue(popup.includes("default.html"), "Expected the default popup to be returned");
-
-    // Set the popup for the first tab.
-    browser.pageAction.setPopup({tabId: tab1.id, popup: "a.html"});
-    popup = await browser.pageAction.getPopup({tabId: tab1.id});
-    browser.test.assertTrue(popup.includes("a.html"), "Expected the first tab popup");
-
-    // Keeps track of the tabs for which onClicked should fire when the page action is clicked on.
-    let expectingOnClicked = {};
-
-    browser.pageAction.onClicked.addListener(tab => {
-      browser.test.assertTrue(expectingOnClicked[tab.id], "The onClicked listener should only fire when we expect it to.");
-      browser.test.sendMessage("page-action-onClicked-fired");
-    });
-
-    browser.test.onMessage.addListener(async (msg, data) => {
-      if (msg === "select-tab") {
-        // Check if the requested tabId is already selected.
-        const [activeTab] = await browser.tabs.query({active: true});
-        if (activeTab.id === data.tabId) {
-          browser.test.sendMessage("tab-selected");
-          return;
-        }
-
-        // Select the requested tabId and wait the tab to be activated.
-        const onActivatedListener = ({tabId}) => {
-          if (tabId === data.tabId) {
-            browser.tabs.onActivated.removeListener(onActivatedListener);
-            browser.test.sendMessage("tab-selected");
-          }
-        };
-        browser.tabs.onActivated.addListener(onActivatedListener);
-
-        await browser.tabs.update(data.tabId, {active: true});
-      } else if (msg === "page-action-show") {
-        await browser.pageAction.show(data.tabId);
-        browser.test.sendMessage("page-action-shown");
-      } else if (msg == "page-action-set-popup") {
-        if (data.popup == "") {
-          expectingOnClicked[data.tabId] = true;
-        } else {
-          delete expectingOnClicked[data.tabId];
-        }
-        await browser.pageAction.setPopup({tabId: data.tabId, popup: data.popup});
-        browser.test.sendMessage("page-action-popup-set");
-      } else if (msg == "page-action-get-popup") {
-        const url = await browser.pageAction.getPopup({tabId: data.tabId});
-        browser.test.sendMessage("page-action-got-popup", url);
-      } else if (msg === "finish") {
-        await browser.tabs.remove([tab1.id, tab2.id]);
-        browser.test.notifyPass("page-action-popup");
-      }
-    });
-
-    browser.test.sendMessage("tabs", {tab1, tab2});
-  }
-
-  function popupScript() {
-    window.onload = () => {
-      browser.test.sendMessage("page-action-from-popup", location.href);
-    };
-
-    browser.test.onMessage.addListener((msg, details) => {
-      if (msg == "page-action-close-popup") {
-        if (details.location == location.href) {
-          window.close();
-        }
-      }
-    });
-  }
-
-  let extension = ExtensionTestUtils.loadExtension({
-    background,
-    manifest: {
-      "name": "PageAction Extension",
-      "page_action": {
-        "default_title": "Page Action",
-        "default_popup": "default.html",
-        "default_icon": {
-          "18": "extension.png",
-        },
-      },
-    },
-    files: {
-      "default.html": `<html><head><meta charset="utf-8"><script src="popup.js"><\/script></head></html>`,
-      "extension.png": TEST_ICON_ARRAYBUFFER,
-      "a.html": `<html><head><meta charset="utf-8"><script src="popup.js"><\/script></head></html>`,
-      "b.html": `<html><head><meta charset="utf-8"><script src="popup.js"><\/script></head></html>`,
-      "popup.js": popupScript,
-    },
-  });
-
-  let tabClosedPromise = () => {
-    return new Promise(resolve => {
-      let chromeWin = Services.wm.getMostRecentWindow("navigator:browser");
-      let BrowserApp = chromeWin.BrowserApp;
-
-      let tabCloseListener = (event) => {
-        BrowserApp.deck.removeEventListener("TabClose", tabCloseListener);
-        let browser = event.target;
-        let url = browser.currentURI.spec;
-        resolve(url);
-      };
-
-      BrowserApp.deck.addEventListener("TabClose", tabCloseListener);
-    });
-  };
-
-  async function testPopup(tabId, expectedPopup, uuid) {
-    extension.sendMessage("page-action-get-popup", {tabId});
-    let actualPopup = await extension.awaitMessage("page-action-got-popup");
-    ok(actualPopup.includes(expectedPopup), `Expected the correct popup for tab ${tabId}`);
-
-    extension.sendMessage("select-tab", {tabId});
-    await extension.awaitMessage("tab-selected");
-
-    extension.sendMessage("page-action-show", {tabId});
-    await extension.awaitMessage("page-action-shown");
-
-    ok(PageActions.isShown(uuid), "page action is shown");
-
-    info(`Click on the pageAction on tab ${tabId} and wait the popup to be loaded`);
-    PageActions.synthesizeClick(uuid);
-    let location = await extension.awaitMessage("page-action-from-popup");
-
-    ok(location.includes(expectedPopup), "The popup with the correct URL should be shown.");
-
-    const onceTabClosed = tabClosedPromise();
-    extension.sendMessage("page-action-close-popup", {location});
-    location = await onceTabClosed;
-    ok(location.includes(expectedPopup), "The popup with the correct URL should be closed");
-  }
-
-  await extension.startup();
-
-  let {tab1, tab2} = await extension.awaitMessage("tabs");
-
-  const uuid = `{${extension.uuid}}`;
-  await testPopup(tab1.id, "a.html", uuid);
-  await testPopup(tab2.id, "b.html", uuid);
-
-  // Test that the default popup is used when the first tabs popup is unset.
-  extension.sendMessage("page-action-set-popup", {tabId: tab1.id, popup: ""});
-  await extension.awaitMessage("page-action-popup-set");
-
-  await testPopup(tab1.id, "default.html", uuid);
-
-  extension.sendMessage("finish");
-  await extension.awaitFinish("page-action-popup");
-
-  await extension.unload();
-});
-
-
-</script>
-
-</body>
-</html>
deleted file mode 100644
--- a/mobile/android/components/extensions/test/mochitest/test_ext_pageAction_show_hide.html
+++ /dev/null
@@ -1,143 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-  <title>PageAction Test</title>
-  <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-  <script src="chrome://mochikit/content/tests/SimpleTest/ExtensionTestUtils.js"></script>
-  <script type="text/javascript" src="head.js"></script>
-  <link rel="stylesheet" href="chrome://mochikit/contents/tests/SimpleTest/test.css"/>
-</head>
-<body>
-
-<script type="text/javascript">
-"use strict";
-
-var {ContentTaskUtils} = SpecialPowers.Cu.import("resource://testing-common/ContentTaskUtils.jsm", {});
-var {PageActions} = SpecialPowers.Cu.import("resource://gre/modules/PageActions.jsm", {});
-
-add_task(async function test_pageAction() {
-  async function background() {
-    let tabCreatedPromise = new Promise(resolve => {
-      let onTabCreated = tab => {
-        browser.tabs.onCreated.removeListener(onTabCreated);
-        resolve();
-      };
-      browser.tabs.onCreated.addListener(onTabCreated);
-    });
-
-    async function createNewTab(url) {
-      let [tab] = await Promise.all([
-        browser.tabs.create({url}),
-        tabCreatedPromise,
-      ]);
-      return tab;
-    }
-
-    let tab1 = await createNewTab("about:blank");
-    let tab2 = await createNewTab("about:blank");
-
-    browser.test.onMessage.addListener(async (msg, data) => {
-      if (msg === "select-tab") {
-        const onActivatedListener = ({tabId}) => {
-          if (tabId === data) {
-            browser.tabs.onActivated.removeListener(onActivatedListener);
-            browser.test.sendMessage("tab-selected");
-          }
-        };
-        browser.tabs.onActivated.addListener(onActivatedListener);
-
-        await browser.tabs.update(data, {active: true});
-      } else if (msg === "pageAction-show") {
-        browser.pageAction.show(data).then(() => {
-          browser.test.sendMessage("page-action-shown");
-        });
-      } else if (msg === "pageAction-hide") {
-        browser.pageAction.hide(data).then(() => {
-          browser.test.sendMessage("page-action-hidden");
-        });
-      } else if (msg === "finish") {
-        await browser.tabs.remove([tab1.id, tab2.id]);
-        browser.test.notifyPass("pageAction");
-      }
-    });
-
-    browser.pageAction.onClicked.addListener(tab => {
-      browser.test.sendMessage("page-action-clicked", tab);
-    });
-
-    browser.test.sendMessage("tabs", {tab1, tab2});
-  }
-
-  const extension = ExtensionTestUtils.loadExtension({
-    background,
-    manifest: {
-      "name": "PageAction Extension",
-      "page_action": {
-        "default_title": "Page Action",
-        "default_icon": {
-          "18": "extension.png",
-        },
-      },
-      "applications": {
-        "gecko": {
-          "id": "foo@bar.com",
-        },
-      },
-    },
-    files: {
-      "extension.png": TEST_ICON_ARRAYBUFFER,
-    },
-  });
-
-  await extension.startup();
-
-  async function checkTab(tabId, uuid, showAfterSelecting) {
-    ok(!PageActions.isShown(uuid), "The PageAction should not be shown");
-
-    if (showAfterSelecting) {
-      extension.sendMessage("select-tab", tabId);
-      await extension.awaitMessage("tab-selected");
-      ok(!PageActions.isShown(uuid), "The PageAction should still not be shown");
-      extension.sendMessage("pageAction-show", tabId);
-      await extension.awaitMessage("page-action-shown");
-      ok(PageActions.isShown(uuid), "The PageAction should be shown");
-    } else {
-      extension.sendMessage("pageAction-show", tabId);
-      await extension.awaitMessage("page-action-shown");
-      ok(!PageActions.isShown(uuid), "The PageAction should still not be shown");
-      extension.sendMessage("select-tab", tabId);
-      await extension.awaitMessage("tab-selected");
-      // Wait until the page action is shown.
-      await ContentTaskUtils.waitForCondition(() => PageActions.isShown(uuid));
-    }
-
-    PageActions.synthesizeClick(uuid);
-    const clickedTab = await extension.awaitMessage("page-action-clicked");
-    is(clickedTab.id, tabId, "Got the expected tab id in the pageAction.onClicked event");
-
-    ok(PageActions.isShown(uuid), "The PageAction should be shown");
-    extension.sendMessage("pageAction-hide", tabId);
-    await extension.awaitMessage("page-action-hidden");
-  }
-
-  const tabs = await extension.awaitMessage("tabs");
-  const uuid = `{${extension.uuid}}`;
-
-  await checkTab(tabs.tab1.id, uuid, true /* showAfterSelecting */);
-  await checkTab(tabs.tab2.id, uuid, false /* showAfterSelecting */);
-
-  // Show the page action for the active tab.
-  extension.sendMessage("pageAction-show", tabs.tab2.id);
-  await extension.awaitMessage("page-action-shown");
-  ok(PageActions.isShown(uuid), "The PageAction should be shown");
-
-  extension.sendMessage("finish");
-  await extension.awaitFinish("pageAction");
-
-  await extension.unload();
-  ok(!PageActions.isShown(uuid), "The PageAction should be removed after unload");
-});
-</script>
-
-</body>
-</html>
deleted file mode 100644
--- a/mobile/android/components/extensions/test/mochitest/test_ext_popup_behavior.html
+++ /dev/null
@@ -1,224 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-  <title>PageAction Test</title>
-  <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-  <script src="chrome://mochikit/content/tests/SimpleTest/ExtensionTestUtils.js"></script>
-  <script type="text/javascript" src="head.js"></script>
-  <link rel="stylesheet" href="chrome://mochikit/contents/tests/SimpleTest/test.css"/>
-</head>
-<body>
-
-<script type="text/javascript">
-"use strict";
-
-var {BrowserActions} = SpecialPowers.Cu.import("resource://gre/modules/BrowserActions.jsm", {});
-var {Services} = SpecialPowers.Cu.import("resource://gre/modules/Services.jsm", {});
-
-function promiseDispatchedWindowEvent(eventName) {
-  return new Promise(resolve => {
-    let chromeWin = Services.wm.getMostRecentWindow("navigator:browser");
-    let WindowEventDispatcher = chromeWin.WindowEventDispatcher;
-
-    let listener = (event) => {
-      WindowEventDispatcher.unregisterListener(listener, eventName);
-      resolve();
-    };
-
-    WindowEventDispatcher.registerListener(listener, eventName);
-  });
-}
-
-async function closeTabAndWaitTabClosed({BrowserApp, tab}) {
-  let onceTabClosed = promiseDispatchedWindowEvent("Tab:Closed");
-  BrowserApp.closeTab(tab);
-  await onceTabClosed;
-}
-
-async function selectTabAndWaitTabSelected({BrowserApp, tab}) {
-  let onceTabSelected = promiseDispatchedWindowEvent("Tab:Selected");
-  BrowserApp.selectTab(tab);
-  await onceTabSelected;
-}
-
-add_task(async function test_popup_behavior() {
-  const chromeWin = Services.wm.getMostRecentWindow("navigator:browser");
-  const BrowserApp = chromeWin.BrowserApp;
-
-  async function background() {
-    const tab1 = await browser.tabs.create({url: "http://example.com#test_popup_behavior_1"});
-    const tab2 = await browser.tabs.create({url: "http://example.com#test_popup_behavior_2"});
-    const tab3 = await browser.tabs.create({url: "http://example.com#test_popup_behavior_3"});
-
-    browser.tabs.onUpdated.addListener((tabId, changeInfo) => {
-      if (![tab1.id, tab2.id, tab3.id].includes(tabId) ||
-          changeInfo.status !== "complete") {
-        return;
-      }
-
-      browser.test.sendMessage("page-loaded", tabId);
-    });
-
-    browser.test.sendMessage("background_page.ready", {
-      tabId1: tab1.id,
-      tabId2: tab2.id,
-      tabId3: tab3.id,
-    });
-  }
-
-  async function popupScript() {
-    browser.test.sendMessage("popup_script.loaded");
-  }
-
-  let popupHtml = `<!DOCTYPE html>
-    <html>
-      <head>
-        <meta charset="utf-8">
-      </head>
-      <body>
-        <h1>Extension Popup</h1>
-        <script src="popup.js"><\/script>
-      </body>
-    </html>
-  `;
-
-  let extension = ExtensionTestUtils.loadExtension({
-    background,
-    manifest: {
-      "name": "BrowserAction Extension",
-      "browser_action": {
-        "default_title": "Browser Action",
-        "default_popup": "popup.html",
-        "default_icon": {
-          "18": "extension.png",
-        },
-      },
-      "permissions": ["activeTab"],
-    },
-    files: {
-      "popup.html": popupHtml,
-      "popup.js": popupScript,
-    },
-  });
-
-  await extension.startup();
-
-  const {
-    tabId1,
-    tabId2,
-    tabId3,
-  } = await extension.awaitMessage("background_page.ready");
-
-  const uuid = `{${extension.uuid}}`;
-
-  ok(BrowserActions.isShown(uuid), "browser action is shown");
-
-  info("Wait the new tabs to be loaded");
-
-  await extension.awaitMessage("page-loaded");
-  await extension.awaitMessage("page-loaded");
-  await extension.awaitMessage("page-loaded");
-
-  is(BrowserApp.selectedTab.id, tabId3, "The third of the new tabs has been selected");
-
-  BrowserActions.synthesizeClick(uuid);
-  await extension.awaitMessage("popup_script.loaded");
-
-  // Check that while the extension popup tab is selected the active tab is still the tab
-  // from which the user has opened the extension popup.
-  ok(BrowserApp.selectedBrowser.currentURI.spec.endsWith("popup.html"),
-     "The first popup tab has been selected");
-
-  let popupParentTabId = BrowserApp.selectedTab.parentId;
-  is(popupParentTabId, tabId3, "The parent of the first popup tab is the third tab");
-
-  // Close the popup and test that its parent tab is selected.
-  await closeTabAndWaitTabClosed({BrowserApp, tab: BrowserApp.selectedTab});
-
-  const tab1 = BrowserApp.getTabForId(tabId1);
-  const tab2 = BrowserApp.getTabForId(tabId2);
-  const tab3 = BrowserApp.getTabForId(tabId3);
-
-  BrowserActions.synthesizeClick(uuid);
-  await extension.awaitMessage("popup_script.loaded");
-
-  ok(BrowserApp.selectedBrowser.currentURI.spec.endsWith("popup.html"),
-     "The second popup tab has been selected");
-
-  popupParentTabId = BrowserApp.selectedTab.parentId;
-  is(popupParentTabId, tabId3, "The parent of the second popup tab is the third tab");
-
-  // Switch to the second tab and expect the popup tab to be closed.
-  let onceTabClosed = promiseDispatchedWindowEvent("Tab:Closed");
-  await Promise.all([
-    selectTabAndWaitTabSelected({BrowserApp, tab: tab2}),
-    onceTabClosed,
-  ]);
-
-  // Switch to the first tab and expect it to be the next selected tab.
-  // (which ensure that Bug 1373170 has been fixed and the closed popup tab
-  // has not selected its parent tab).
-  await selectTabAndWaitTabSelected({BrowserApp, tab: tab1});
-
-  is(BrowserApp.selectedTab.id, tabId1,
-     "The first tab is the currently selected tab");
-
-  // Close all the tabs before exiting the test.
-  await Promise.all([
-    closeTabAndWaitTabClosed({BrowserApp, tab: tab1}),
-    closeTabAndWaitTabClosed({BrowserApp, tab: tab2}),
-    closeTabAndWaitTabClosed({BrowserApp, tab: tab3}),
-  ]);
-
-  await extension.unload();
-});
-
-add_task(async function test_popup_incognito() {
-  const chromeWin = Services.wm.getMostRecentWindow("navigator:browser");
-  const BrowserApp = chromeWin.BrowserApp;
-  const extension = ExtensionTestUtils.loadExtension({
-    background() {
-      browser.tabs.onCreated.addListener(async (tab) => {
-        browser.test.sendMessage("page-loaded", tab);
-      });
-    },
-    manifest: {
-      "name": "BrowserAction Extension",
-      "browser_action": {
-        "default_popup": "popup.html",
-      },
-    },
-    files: {
-      "popup.html": "<h1>Extension Popup</h1>",
-    },
-  });
-
-  await extension.startup();
-  const uuid = `{${extension.uuid}}`;
-  ok(BrowserActions.isShown(uuid), "Browser action should be shown");
-
-  for (let isPrivate of [false, true]) {
-    // Open tab with provided privateness
-    let nativeTab = BrowserApp.addTab("http://example.com/#normal", {
-      isPrivate,
-      selected: true,
-    });
-    let tab = await extension.awaitMessage("page-loaded");
-    is(tab.incognito, isPrivate, "Tab should have expected privateness");
-
-    // Open browserAction popup in that tab
-    BrowserActions.synthesizeClick(uuid);
-    let popup = await extension.awaitMessage("page-loaded");
-    is(popup.incognito, isPrivate, "Popup should have same privateness as tab");
-
-    // Close popup and tab
-    await closeTabAndWaitTabClosed({BrowserApp, tab: BrowserApp.selectedTab});
-    await closeTabAndWaitTabClosed({BrowserApp, tab: nativeTab});
-  }
-
-  await extension.unload();
-});
-</script>
-
-</body>
-</html>
--- a/mobile/android/components/extensions/test/mochitest/test_ext_tabs_query.html
+++ b/mobile/android/components/extensions/test/mochitest/test_ext_tabs_query.html
@@ -7,84 +7,16 @@
   <script type="text/javascript" src="head.js"></script>
   <link rel="stylesheet" href="/tests/SimpleTest/test.css"/>
 </head>
 <body>
 
 <script type="text/javascript">
 "use strict";
 
-var {BrowserActions} = SpecialPowers.Cu.import("resource://gre/modules/BrowserActions.jsm", {});
-var {Services} = SpecialPowers.Cu.import("resource://gre/modules/Services.jsm", {});
-
-add_task(async function test_query_highlighted() {
-  if (true) {
-    // GeckoView does not support extension popups
-    todo(false, 'skipping test_query_highlighted');
-    return;
-  }
-  let extension = ExtensionTestUtils.loadExtension({
-    manifest: {
-      "permissions": ["tabs"],
-      "browser_action": {
-        "default_popup": "popup.html",
-      },
-    },
-
-    background: async function() {
-      let tabs1 = await browser.tabs.query({highlighted: false});
-      browser.test.assertEq(3, tabs1.length, "should have three non-highlighted tabs");
-
-      let tabs2 = await browser.tabs.query({highlighted: true});
-      browser.test.assertEq(1, tabs2.length, "should have one highlighted tab");
-
-      for (let tab of [...tabs1, ...tabs2]) {
-        browser.test.assertEq(tab.active, tab.highlighted, "highlighted and active are equal in tab " + tab.index);
-      }
-
-      browser.test.notifyPass("tabs.query");
-    },
-
-    files: {
-      "popup.html": `<script src="popup.js"><\/script>`,
-      "popup.js": async function popupScript() {
-        let active = await browser.tabs.query({active: true});
-        let highlighted = await browser.tabs.query({highlighted: true});
-
-        browser.test.assertEq(1, active.length, "should have one active tab");
-        browser.test.assertEq(1, highlighted.length, "should have one highlighted tab");
-        browser.test.assertEq(active[0].id, highlighted[0].id, "the active and highlighted tabs are the same one");
-        browser.test.assertEq(true, active[0].active, "the tab should be considered to be active");
-        browser.test.assertEq(true, active[0].highlighted, "the tab should be considered to be highlighted");
-
-        browser.test.sendMessage("tabs.query.popup");
-      },
-    },
-  });
-
-  const {BrowserApp} = Services.wm.getMostRecentWindow("navigator:browser");
-  let tabs = [];
-  for (let url of ["http://example.com/", "http://example.net/", "http://test1.example.org/MochiKit/"]) {
-    tabs.push(BrowserApp.addTab(url));
-  }
-
-  await extension.startup();
-  await extension.awaitFinish("tabs.query");
-
-  // Open popup
-  BrowserActions.synthesizeClick(`{${extension.uuid}}`);
-  await extension.awaitMessage("tabs.query.popup");
-
-  await extension.unload();
-
-  for (let tab of tabs) {
-    BrowserApp.closeTab(tab);
-  }
-});
-
 add_task(async function test_query_index() {
   let extension = ExtensionTestUtils.loadExtension({
     manifest: {
       "permissions": ["tabs"],
     },
 
     background: function() {
       browser.tabs.onCreated.addListener(async function({index, windowId, id}) {
deleted file mode 100644
--- a/mobile/android/modules/BrowserActions.jsm
+++ /dev/null
@@ -1,146 +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 { EventDispatcher } = ChromeUtils.import(
-  "resource://gre/modules/Messaging.jsm"
-);
-
-var EXPORTED_SYMBOLS = ["BrowserActions"];
-
-var BrowserActions = {
-  _browserActions: {},
-  _browserActionTitles: {},
-
-  _initialized: false,
-
-  /**
-   * Registers the listeners only if they have not been initialized
-   * already and there is at least one browser action.
-   */
-  _maybeRegisterListeners() {
-    if (!this._initialized && Object.keys(this._browserActions).length) {
-      this._initialized = true;
-      EventDispatcher.instance.registerListener(this, "Menu:Clicked");
-    }
-  },
-
-  /**
-   * Unregisters the listeners if they are already initizliaed and
-   * all of the browser actions have been removed.
-   */
-  _maybeUnregisterListeners() {
-    if (this._initialized && !Object.keys(this._browserActions).length) {
-      this._initialized = false;
-      EventDispatcher.instance.unregisterListener(this, "Menu:Clicked");
-    }
-  },
-
-  /**
-   * Called when a browser action is clicked on.
-   * @param {string} event The name of the event, which should always
-   *    be "Menu:Clicked".
-   * @param {Object} data An object containing information about the
-   *    browser action, which in this case should contain an `item`
-   *    property which is browser action's UUID.
-   */
-  onEvent(event, data) {
-    if (event !== "Menu:Clicked") {
-      throw new Error(
-        `Expected "Menu:Clicked" event - received "${event}" instead`
-      );
-    }
-
-    let browserAction = this._browserActions[data.item];
-    if (!browserAction) {
-      // This was probably meant for the NativeWindow menu handler.
-      return;
-    }
-    browserAction.onClicked();
-  },
-
-  /**
-   * Registers a new browser action.
-   * @param {Object} browserAction The browser action to add.
-   */
-  register(browserAction) {
-    EventDispatcher.instance.sendRequest({
-      type: "Menu:Add",
-      uuid: browserAction.uuid,
-      name: browserAction.defaults.name,
-    });
-
-    this._browserActions[browserAction.uuid] = browserAction;
-    this._browserActionTitles[browserAction.uuid] = browserAction.defaults.name;
-
-    this._maybeRegisterListeners();
-  },
-
-  /**
-   * Updates the browser action with the specified UUID.
-   * @param {string} uuid The UUID of the browser action.
-   * @param {Object} options The properties to update.
-   */
-  update(uuid, options) {
-    if (options.name) {
-      EventDispatcher.instance.sendRequest({
-        type: "Menu:Update",
-        uuid,
-        options,
-      });
-
-      this._browserActionTitles[uuid] = options.name;
-    }
-  },
-
-  /**
-   * Retrieves the name currently used for the browser action with the
-   * specified UUID. Used for testing only.
-   * @param {string} uuid The UUID of the browser action.
-   * @returns {string} the name currently used for the browser action.
-   */
-  getNameForActiveTab(uuid) {
-    return this._browserActionTitles[uuid];
-  },
-
-  /**
-   * Checks to see if the browser action is shown. Used for testing only.
-   * @param {string} uuid The UUID of the browser action.
-   * @returns {boolean} true if the browser action is shown; false otherwise.
-   */
-  isShown(uuid) {
-    return !!this._browserActions[uuid];
-  },
-
-  /**
-   * Synthesizes a click on the browser action. Used for testing only.
-   * @param {string} uuid The UUID of the browser action.
-   */
-  synthesizeClick(uuid) {
-    let browserAction = this._browserActions[uuid];
-    if (!browserAction) {
-      throw new Error(`No BrowserAction with UUID ${uuid} was found`);
-    }
-    browserAction.onClicked();
-  },
-
-  /**
-   * Unregisters the browser action with the specified UUID.
-   * @param {string} uuid The UUID of the browser action.
-   */
-  unregister(uuid) {
-    let browserAction = this._browserActions[uuid];
-    if (!browserAction) {
-      throw new Error(`No BrowserAction with UUID ${uuid} was found`);
-    }
-    EventDispatcher.instance.sendRequest({
-      type: "Menu:Remove",
-      uuid,
-    });
-    delete this._browserActions[uuid];
-    delete this._browserActionTitles[uuid];
-    this._maybeUnregisterListeners();
-  },
-};
deleted file mode 100644
--- a/mobile/android/modules/PageActions.jsm
+++ /dev/null
@@ -1,129 +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 { XPCOMUtils } = ChromeUtils.import(
-  "resource://gre/modules/XPCOMUtils.jsm"
-);
-const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
-const { EventDispatcher } = ChromeUtils.import(
-  "resource://gre/modules/Messaging.jsm"
-);
-
-XPCOMUtils.defineLazyServiceGetter(
-  this,
-  "uuidgen",
-  "@mozilla.org/uuid-generator;1",
-  "nsIUUIDGenerator"
-);
-
-var EXPORTED_SYMBOLS = ["PageActions"];
-
-// Copied from browser.js
-// TODO: We should move this method to a common importable location
-function resolveGeckoURI(aURI) {
-  if (!aURI) {
-    throw new Error("Can't resolve an empty uri");
-  }
-
-  if (aURI.startsWith("chrome://")) {
-    let registry = Cc["@mozilla.org/chrome/chrome-registry;1"].getService(
-      Ci.nsIChromeRegistry
-    );
-    return registry.convertChromeURL(Services.io.newURI(aURI)).spec;
-  } else if (aURI.startsWith("resource://")) {
-    let handler = Services.io
-      .getProtocolHandler("resource")
-      .QueryInterface(Ci.nsIResProtocolHandler);
-    return handler.resolveURI(Services.io.newURI(aURI));
-  }
-  return aURI;
-}
-
-var PageActions = {
-  _items: {},
-
-  _initialized: false,
-
-  _maybeInitialize: function() {
-    if (!this._initialized && Object.keys(this._items).length) {
-      this._initialized = true;
-      EventDispatcher.instance.registerListener(this, [
-        "PageActions:Clicked",
-        "PageActions:LongClicked",
-      ]);
-    }
-  },
-
-  _maybeUninitialize: function() {
-    if (this._initialized && !Object.keys(this._items).length) {
-      this._initialized = false;
-      EventDispatcher.instance.unregisterListener(this, [
-        "PageActions:Clicked",
-        "PageActions:LongClicked",
-      ]);
-    }
-  },
-
-  onEvent: function(event, data, callback) {
-    let item = this._items[data.id];
-    if (event == "PageActions:Clicked") {
-      if (item.clickCallback) {
-        item.clickCallback();
-      }
-    } else if (event == "PageActions:LongClicked") {
-      if (item.longClickCallback) {
-        item.longClickCallback();
-      }
-    }
-  },
-
-  isShown: function(id) {
-    return !!this._items[id];
-  },
-
-  synthesizeClick: function(id) {
-    let item = this._items[id];
-    if (item && item.clickCallback) {
-      item.clickCallback();
-    }
-  },
-
-  add: function(aOptions) {
-    let id = aOptions.id || uuidgen.generateUUID().toString();
-
-    EventDispatcher.instance.sendRequest({
-      type: "PageActions:Add",
-      id: id,
-      title: aOptions.title,
-      icon: resolveGeckoURI(aOptions.icon),
-      important: "important" in aOptions ? aOptions.important : false,
-      useTint: "useTint" in aOptions ? aOptions.useTint : false,
-    });
-
-    this._items[id] = {};
-
-    if (aOptions.clickCallback) {
-      this._items[id].clickCallback = aOptions.clickCallback;
-    }
-
-    if (aOptions.longClickCallback) {
-      this._items[id].longClickCallback = aOptions.longClickCallback;
-    }
-
-    this._maybeInitialize();
-    return id;
-  },
-
-  remove: function(id) {
-    EventDispatcher.instance.sendRequest({
-      type: "PageActions:Remove",
-      id: id,
-    });
-
-    delete this._items[id];
-    this._maybeUninitialize();
-  },
-};
--- a/mobile/android/modules/moz.build
+++ b/mobile/android/modules/moz.build
@@ -17,30 +17,28 @@ with Files('HomeProvider.jsm'):
 with Files('geckoview/**'):
     BUG_COMPONENT = ('GeckoView', 'General')
 
 DIRS += ['geckoview']
 
 EXTRA_JS_MODULES += [
     'Accounts.jsm',
     'ActionBarHandler.jsm',
-    'BrowserActions.jsm',
     'dbg-browser-actors.js',
     'DownloadNotifications.jsm',
     'FormAssistant.jsm',
     'FxAccountsWebChannel.jsm',
     'HelperApps.jsm',
     'Home.jsm',
     'HomeProvider.jsm',
     'InputWidgetHelper.jsm',
     'LightweightThemeConsumer.jsm',
     'MediaPlayerApp.jsm',
     'NetErrorHelper.jsm',
     'Notifications.jsm',
-    'PageActions.jsm',
     'Prompt.jsm',
     'RuntimePermissions.jsm',
     'Sanitizer.jsm',
     'SelectHelper.jsm',
     'SharedPreferences.jsm',
     'Snackbars.jsm',
     'WebrtcUI.jsm',
     'WebsiteMetadata.jsm'