Backed out changeset 3d9ddc7244ad (bug 1313459) for bunch of browser chrome failures
authorIris Hsiao <ihsiao@mozilla.com>
Tue, 21 Feb 2017 10:21:49 +0800
changeset 392910 1fc93c32ef2e2502ad5cf6d1ece4119da349c96e
parent 392909 de7b0d3dacd552143acbd0ae3091804301e5f587
child 392911 a882ebcaba283799fb3afec826826759b2f0e30d
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 out3d9ddc7244ad9eb306efa802773c6e30a4b645f0
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 3d9ddc7244ad (bug 1313459) for bunch of browser chrome failures
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": {
-                "type": "string",
-                "default": "navbar",
-                "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);
-});