Backed out changeset 14dbbe36e676 (bug 1313459) for browser_ext_browserAction_area.js timeouts
authorPhil Ringnalda <philringnalda@gmail.com>
Tue, 21 Feb 2017 19:58:54 -0800
changeset 393102 e52cd3f75ebfeacb1bd2a39df6175fa919777f49
parent 393101 7d6717b64c82545afffe44766fba0054937324f9
child 393103 e863fac5d373b4227f9155577c856b8bb05fd855
push id1468
push userasasaki@mozilla.com
push dateMon, 05 Jun 2017 19:31:07 +0000
treeherdermozilla-release@0641fc6ee9d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1313459
milestone54.0a1
backs out14dbbe36e676e23b54c7e2b4a2c29ce4f24bba66
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
Backed out changeset 14dbbe36e676 (bug 1313459) for browser_ext_browserAction_area.js timeouts
browser/components/extensions/ext-browserAction.js
browser/components/extensions/schemas/browser_action.json
browser/components/extensions/test/browser/browser-common.ini
browser/components/extensions/test/browser/browser_ext_browserAction_area.js
--- a/browser/components/extensions/ext-browserAction.js
+++ b/browser/components/extensions/ext-browserAction.js
@@ -33,24 +33,17 @@ function isAncestorOrSelf(target, node) 
     if (node === target) {
       return true;
     }
   }
   return false;
 }
 
 // WeakMap[Extension -> BrowserAction]
-const browserActionMap = new WeakMap();
-
-const browserAreas = {
-  "navbar": CustomizableUI.AREA_NAVBAR,
-  "menupanel": CustomizableUI.AREA_PANEL,
-  "tabstrip": CustomizableUI.AREA_TABSTRIP,
-  "personaltoolbar": CustomizableUI.AREA_BOOKMARKS,
-};
+var browserActionMap = new WeakMap();
 
 // Responsible for the browser_action section of the manifest as well
 // as the associated popup.
 function BrowserAction(options, extension) {
   this.extension = extension;
 
   let widgetId = makeWidgetId(extension.id);
   this.id = `${widgetId}-browser-action`;
@@ -64,17 +57,16 @@ function BrowserAction(options, extensio
 
   this.defaults = {
     enabled: true,
     title: options.default_title || extension.name,
     badgeText: "",
     badgeBackgroundColor: null,
     icon: IconDetails.normalize({path: options.default_icon}, extension),
     popup: options.default_popup || "",
-    area: browserAreas[options.default_area || "navbar"],
   };
 
   this.browserStyle = options.browser_style || false;
   if (options.browser_style === null) {
     this.extension.logger.warn("Please specify whether you want browser_style " +
                                "or not in your browser_action options.");
   }
 
@@ -88,17 +80,17 @@ BrowserAction.prototype = {
   build() {
     let widget = CustomizableUI.createWidget({
       id: this.id,
       viewId: this.viewId,
       type: "view",
       removable: true,
       label: this.defaults.title || this.extension.name,
       tooltiptext: this.defaults.title || "",
-      defaultArea: this.defaults.area,
+      defaultArea: CustomizableUI.AREA_NAVBAR,
 
       onBeforeCreated: document => {
         let view = document.createElementNS(XUL_NS, "panelview");
         view.id = this.viewId;
         view.setAttribute("flex", "1");
 
         document.getElementById("PanelUI-multiView").appendChild(view);
         document.addEventListener("popupshowing", this);
--- a/browser/components/extensions/schemas/browser_action.json
+++ b/browser/components/extensions/schemas/browser_action.json
@@ -26,22 +26,16 @@
                 "type": "string",
                 "format": "relativeUrl",
                 "optional": true,
                 "preprocess": "localize"
               },
               "browser_style": {
                 "type": "boolean",
                 "optional": true
-              },
-              "default_area": {
-                "description": "Defines the location the browserAction will appear by default.  The default location is navbar.",
-                "type": "string",
-                "enum": ["navbar", "menupanel", "tabstrip", "personaltoolbar"],
-                "optional": true
               }
             },
             "optional": true
           }
         }
       }
     ]
   },
--- a/browser/components/extensions/test/browser/browser-common.ini
+++ b/browser/components/extensions/test/browser/browser-common.ini
@@ -19,17 +19,16 @@ support-files =
   file_dummy.html
   file_inspectedwindow_reload_target.sjs
   file_serviceWorker.html
   serviceWorker.js
   searchSuggestionEngine.xml
   searchSuggestionEngine.sjs
   ../../../../../toolkit/components/extensions/test/mochitest/head_webrequest.js
 
-[browser_ext_browserAction_area.js]
 [browser_ext_browserAction_context.js]
 [browser_ext_browserAction_disabled.js]
 [browser_ext_browserAction_pageAction_icon.js]
 [browser_ext_browserAction_pageAction_icon_permissions.js]
 [browser_ext_browserAction_popup.js]
 [browser_ext_browserAction_popup_preload.js]
 [browser_ext_browserAction_popup_resize.js]
 [browser_ext_browserAction_simple.js]
deleted file mode 100644
--- a/browser/components/extensions/test/browser/browser_ext_browserAction_area.js
+++ /dev/null
@@ -1,73 +0,0 @@
-/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set sts=2 sw=2 et tw=80: */
-"use strict";
-
-var browserAreas = {
-  "navbar": CustomizableUI.AREA_NAVBAR,
-  "menupanel": CustomizableUI.AREA_PANEL,
-  "tabstrip": CustomizableUI.AREA_TABSTRIP,
-  "personaltoolbar": CustomizableUI.AREA_BOOKMARKS,
-};
-
-function* testInArea(area) {
-  let manifest = {
-    "browser_action": {
-      "default_popup": "popup.html",
-      "browser_style": true,
-    },
-  };
-  if (area) {
-    manifest.browser_action.default_area = area;
-  }
-  let extension = ExtensionTestUtils.loadExtension({
-    manifest,
-    files: {
-      "popup.html": `
-      <!DOCTYPE html>
-      <html><head>
-      <meta charset="utf-8"/>
-      <script src="popup.js"></script>
-      </head><body>
-      </body></html>
-      `,
-
-      "popup.js": function() {
-        window.onload = () => {
-          browser.test.sendMessage("from-popup");
-        };
-      },
-    },
-  });
-  yield extension.startup();
-  let widget = getBrowserActionWidget(extension);
-  let placement = CustomizableUI.getPlacementOfWidget(widget.id);
-  is(placement && placement.area, browserAreas[area || "navbar"], `widget located in correct area`);
-
-  clickBrowserAction(extension);
-
-  yield extension.awaitMessage("from-popup");
-
-  yield extension.unload();
-}
-
-add_task(function* testBrowserActionDefaultArea() {
-  yield testInArea();
-});
-
-add_task(function* testBrowserActionInToolbar() {
-  yield testInArea("navbar");
-});
-
-add_task(function* testBrowserActionInMenuPanel() {
-  yield testInArea("menupanel");
-});
-
-add_task(function* testBrowserActionInTabStrip() {
-  yield testInArea("tabstrip");
-});
-
-add_task(function* testBrowserActionInPersonalToolbar() {
-  CustomizableUI.setToolbarVisibility("PersonalToolbar", true);
-  yield testInArea("personaltoolbar");
-  CustomizableUI.setToolbarVisibility("PersonalToolbar", false);
-});