Bug 1324062. Part 2 - Fix CustomizableUI test failures due to NIGHTLY-only Report Site Issue button. r=Gijs
☠☠ backed out by 16e7adbfad36 ☠ ☠
authorMike Taylor <miket@mozilla.com>
Tue, 17 Jan 2017 14:28:25 -0600
changeset 377592 054cfcf60c7585d2bb082db5c441bfa531db427a
parent 377591 1658b20cb69c92497cceb6254c2f63de08faff12
child 377593 d01f82be01f1ffe1399d5161d6c036d94afbe527
push id1419
push userjlund@mozilla.com
push dateMon, 10 Apr 2017 20:44:07 +0000
treeherdermozilla-release@5e6801b73ef6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs
bugs1324062
milestone53.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 1324062. Part 2 - Fix CustomizableUI test failures due to NIGHTLY-only Report Site Issue button. r=Gijs MozReview-Commit-ID: 8fZMVz05X6n
browser/components/customizableui/test/browser_876944_customize_mode_create_destroy.js
browser/components/customizableui/test/browser_880382_drag_wide_widgets_in_panel.js
browser/components/customizableui/test/browser_890140_orphaned_placeholders.js
browser/components/customizableui/test/browser_967000_button_sync.js
browser/components/customizableui/test/head.js
--- a/browser/components/customizableui/test/browser_876944_customize_mode_create_destroy.js
+++ b/browser/components/customizableui/test/browser_876944_customize_mode_create_destroy.js
@@ -25,26 +25,31 @@ add_task(function* testWrapUnwrap() {
 });
 
 // Creating and destroying a widget should correctly deal with panel placeholders
 add_task(function* testPanelPlaceholders() {
   let panel = document.getElementById(CustomizableUI.AREA_PANEL);
   // The value of expectedPlaceholders depends on the default palette layout.
   // Bug 1229236 is for these tests to be smarter so the test doesn't need to
   // change when the default placements change.
-  let expectedPlaceholders = 1 + (isInDevEdition() ? 1 : 0);
+  let expectedPlaceholders = 1;
+  if (isInDevEdition()) {
+    expectedPlaceholders += 1;
+  } else if (isInNightly()) {
+    expectedPlaceholders += 2;
+  }
   is(panel.querySelectorAll(".panel-customization-placeholder").length, expectedPlaceholders, "The number of placeholders should be correct.");
   CustomizableUI.createWidget({id: kTestWidget2, label: "Pretty label", tooltiptext: "Pretty tooltip", defaultArea: CustomizableUI.AREA_PANEL});
   let elem = document.getElementById(kTestWidget2);
   let wrapper = document.getElementById("wrapper-" + kTestWidget2);
   ok(elem, "There should be an item");
   ok(wrapper, "There should be a wrapper");
   is(wrapper.firstChild.id, kTestWidget2, "Wrapper should have test widget");
   is(wrapper.parentNode, panel, "Wrapper should be in panel");
-  expectedPlaceholders = isInDevEdition() ? 1 : 3;
+  expectedPlaceholders = (expectedPlaceholders - 1) || 3;
   is(panel.querySelectorAll(".panel-customization-placeholder").length, expectedPlaceholders, "The number of placeholders should be correct.");
   CustomizableUI.destroyWidget(kTestWidget2);
   wrapper = document.getElementById("wrapper-" + kTestWidget2);
   ok(!wrapper, "There should be a wrapper");
   let item = document.getElementById(kTestWidget2);
   ok(!item, "There should no longer be an item");
   yield endCustomizing();
 });
--- a/browser/components/customizableui/test/browser_880382_drag_wide_widgets_in_panel.js
+++ b/browser/components/customizableui/test/browser_880382_drag_wide_widgets_in_panel.js
@@ -19,18 +19,19 @@ add_task(function*() {
                              "print-button",
                              "history-panelmenu",
                              "fullscreen-button",
                              "find-button",
                              "preferences-button",
                              "add-ons-button",
                              "developer-button",
                              "sync-button",
+                             "webcompat-reporter-button"
                             ];
-  removeDeveloperButtonIfDevEdition(placementsAfterMove);
+  removeNonReleaseButtons(placementsAfterMove);
   simulateItemDrag(zoomControls, printButton);
   assertAreaPlacements(CustomizableUI.AREA_PANEL, placementsAfterMove);
   ok(!CustomizableUI.inDefaultState, "Should no longer be in default state.");
   let newWindowButton = document.getElementById("new-window-button");
   simulateItemDrag(zoomControls, newWindowButton);
   ok(CustomizableUI.inDefaultState, "Should be in default state again.");
 });
 
@@ -47,18 +48,19 @@ add_task(function*() {
                              "print-button",
                              "history-panelmenu",
                              "fullscreen-button",
                              "find-button",
                              "preferences-button",
                              "add-ons-button",
                              "developer-button",
                              "sync-button",
+                             "webcompat-reporter-button"
                             ];
-  removeDeveloperButtonIfDevEdition(placementsAfterMove);
+  removeNonReleaseButtons(placementsAfterMove);
   simulateItemDrag(zoomControls, savePageButton);
   assertAreaPlacements(CustomizableUI.AREA_PANEL, placementsAfterMove);
   ok(CustomizableUI.inDefaultState, "Should be in default state.");
 });
 
 
 // Dragging the zoom controls to be before the new-window button should not move any widgets.
 add_task(function*() {
@@ -73,18 +75,19 @@ add_task(function*() {
                              "print-button",
                              "history-panelmenu",
                              "fullscreen-button",
                              "find-button",
                              "preferences-button",
                              "add-ons-button",
                              "developer-button",
                              "sync-button",
+                             "webcompat-reporter-button"
                             ];
-  removeDeveloperButtonIfDevEdition(placementsAfterMove);
+  removeNonReleaseButtons(placementsAfterMove);
   simulateItemDrag(zoomControls, newWindowButton);
   assertAreaPlacements(CustomizableUI.AREA_PANEL, placementsAfterMove);
   ok(CustomizableUI.inDefaultState, "Should still be in default state.");
 });
 
 // Dragging the zoom controls to be before the history-panelmenu should move the zoom-controls in to the row higher than the history-panelmenu.
 add_task(function*() {
   yield startCustomizing();
@@ -98,18 +101,19 @@ add_task(function*() {
                              "print-button",
                              "history-panelmenu",
                              "fullscreen-button",
                              "find-button",
                              "preferences-button",
                              "add-ons-button",
                              "developer-button",
                              "sync-button",
+                             "webcompat-reporter-button"
                             ];
-  removeDeveloperButtonIfDevEdition(placementsAfterMove);
+  removeNonReleaseButtons(placementsAfterMove);
   simulateItemDrag(zoomControls, historyPanelMenu);
   assertAreaPlacements(CustomizableUI.AREA_PANEL, placementsAfterMove);
   ok(!CustomizableUI.inDefaultState, "Should no longer be in default state.");
   let newWindowButton = document.getElementById("new-window-button");
   simulateItemDrag(zoomControls, newWindowButton);
   ok(CustomizableUI.inDefaultState, "Should be in default state again.");
 });
 
@@ -127,18 +131,19 @@ add_task(function*() {
                              "history-panelmenu",
                              "fullscreen-button",
                              "zoom-controls",
                              "find-button",
                              "preferences-button",
                              "add-ons-button",
                              "developer-button",
                              "sync-button",
+                             "webcompat-reporter-button"
                             ];
-  removeDeveloperButtonIfDevEdition(placementsAfterMove);
+  removeNonReleaseButtons(placementsAfterMove);
   simulateItemDrag(zoomControls, preferencesButton);
   assertAreaPlacements(CustomizableUI.AREA_PANEL, placementsAfterMove);
   ok(!CustomizableUI.inDefaultState, "Should no longer be in default state.");
   let newWindowButton = document.getElementById("new-window-button");
   simulateItemDrag(zoomControls, newWindowButton);
   ok(CustomizableUI.inDefaultState, "Should be in default state again.");
 });
 
@@ -156,18 +161,19 @@ add_task(function*() {
                                "print-button",
                                "history-panelmenu",
                                "fullscreen-button",
                                "find-button",
                                "preferences-button",
                                "add-ons-button",
                                "developer-button",
                                "sync-button",
+                               "webcompat-reporter-button"
                               ];
-  removeDeveloperButtonIfDevEdition(placementsAfterInsert);
+  removeNonReleaseButtons(placementsAfterInsert);
   simulateItemDrag(openFileButton, zoomControls);
   assertAreaPlacements(CustomizableUI.AREA_PANEL, placementsAfterInsert);
   ok(!CustomizableUI.inDefaultState, "Should no longer be in default state.");
   let palette = document.getElementById("customization-palette");
   // Check that the palette items are re-wrapped correctly.
   let feedWrapper = document.getElementById("wrapper-feed-button");
   let feedButton = document.getElementById("feed-button");
   is(feedButton.parentNode, feedWrapper,
@@ -197,18 +203,19 @@ add_task(function*() {
                                "print-button",
                                "history-panelmenu",
                                "fullscreen-button",
                                "find-button",
                                "preferences-button",
                                "add-ons-button",
                                "developer-button",
                                "sync-button",
+                               "webcompat-reporter-button"
                               ];
-  removeDeveloperButtonIfDevEdition(placementsAfterInsert);
+  removeNonReleaseButtons(placementsAfterInsert);
   simulateItemDrag(openFileButton, editControls);
   assertAreaPlacements(CustomizableUI.AREA_PANEL, placementsAfterInsert);
   ok(!CustomizableUI.inDefaultState, "Should no longer be in default state.");
   let palette = document.getElementById("customization-palette");
   // Check that the palette items are re-wrapped correctly.
   let feedWrapper = document.getElementById("wrapper-feed-button");
   let feedButton = document.getElementById("feed-button");
   is(feedButton.parentNode, feedWrapper,
@@ -235,18 +242,19 @@ add_task(function*() {
                              "print-button",
                              "history-panelmenu",
                              "fullscreen-button",
                              "find-button",
                              "preferences-button",
                              "add-ons-button",
                              "developer-button",
                              "sync-button",
+                             "webcompat-reporter-button"
                             ];
-  removeDeveloperButtonIfDevEdition(placementsAfterMove);
+  removeNonReleaseButtons(placementsAfterMove);
   simulateItemDrag(editControls, zoomControls);
   assertAreaPlacements(CustomizableUI.AREA_PANEL, placementsAfterMove);
   ok(CustomizableUI.inDefaultState, "Should still be in default state.");
 });
 
 // Dragging the edit-controls to be before the new-window-button should
 // move the zoom-controls before the edit-controls.
 add_task(function*() {
@@ -261,18 +269,19 @@ add_task(function*() {
                              "print-button",
                              "history-panelmenu",
                              "fullscreen-button",
                              "find-button",
                              "preferences-button",
                              "add-ons-button",
                              "developer-button",
                              "sync-button",
+                             "webcompat-reporter-button"
                             ];
-  removeDeveloperButtonIfDevEdition(placementsAfterMove);
+  removeNonReleaseButtons(placementsAfterMove);
   simulateItemDrag(editControls, newWindowButton);
   assertAreaPlacements(CustomizableUI.AREA_PANEL, placementsAfterMove);
   let zoomControls = document.getElementById("zoom-controls");
   simulateItemDrag(editControls, zoomControls);
   ok(CustomizableUI.inDefaultState, "Should still be in default state.");
 });
 
 // Dragging the edit-controls to be before the privatebrowsing-button
@@ -290,18 +299,19 @@ add_task(function*() {
                              "print-button",
                              "history-panelmenu",
                              "fullscreen-button",
                              "find-button",
                              "preferences-button",
                              "add-ons-button",
                              "developer-button",
                              "sync-button",
+                             "webcompat-reporter-button"
                             ];
-  removeDeveloperButtonIfDevEdition(placementsAfterMove);
+  removeNonReleaseButtons(placementsAfterMove);
   simulateItemDrag(editControls, privateBrowsingButton);
   assertAreaPlacements(CustomizableUI.AREA_PANEL, placementsAfterMove);
   let zoomControls = document.getElementById("zoom-controls");
   simulateItemDrag(editControls, zoomControls);
   ok(CustomizableUI.inDefaultState, "Should still be in default state.");
 });
 
 // Dragging the edit-controls to be before the save-page-button
@@ -319,18 +329,19 @@ add_task(function*() {
                              "print-button",
                              "history-panelmenu",
                              "fullscreen-button",
                              "find-button",
                              "preferences-button",
                              "add-ons-button",
                              "developer-button",
                              "sync-button",
+                             "webcompat-reporter-button"
                             ];
-  removeDeveloperButtonIfDevEdition(placementsAfterMove);
+  removeNonReleaseButtons(placementsAfterMove);
   simulateItemDrag(editControls, savePageButton);
   assertAreaPlacements(CustomizableUI.AREA_PANEL, placementsAfterMove);
   let zoomControls = document.getElementById("zoom-controls");
   simulateItemDrag(editControls, zoomControls);
   ok(CustomizableUI.inDefaultState, "Should still be in default state.");
 });
 
 // Dragging the edit-controls to the panel itself should append
@@ -348,21 +359,27 @@ add_task(function*() {
                              "fullscreen-button",
                              "find-button",
                              "preferences-button",
                              "add-ons-button",
                              "edit-controls",
                              "developer-button",
                              "sync-button",
                             ];
-  removeDeveloperButtonIfDevEdition(placementsAfterMove);
+  removeNonReleaseButtons(placementsAfterMove);
+  if (isInNightly()) {
+    CustomizableUI.removeWidgetFromArea("webcompat-reporter-button");
+  }
   simulateItemDrag(editControls, panel);
   assertAreaPlacements(CustomizableUI.AREA_PANEL, placementsAfterMove);
   let zoomControls = document.getElementById("zoom-controls");
   simulateItemDrag(editControls, zoomControls);
+  if (isInNightly()) {
+    CustomizableUI.addWidgetToArea("webcompat-reporter-button", CustomizableUI.AREA_PANEL);
+  }
   ok(CustomizableUI.inDefaultState, "Should still be in default state.");
 });
 
 // Dragging the edit-controls to the customization-palette and
 // back should work.
 add_task(function*() {
   yield startCustomizing();
   let editControls = document.getElementById("edit-controls");
@@ -374,18 +391,19 @@ add_task(function*() {
                              "print-button",
                              "history-panelmenu",
                              "fullscreen-button",
                              "find-button",
                              "preferences-button",
                              "add-ons-button",
                              "developer-button",
                              "sync-button",
+                             "webcompat-reporter-button",
                             ];
-  removeDeveloperButtonIfDevEdition(placementsAfterMove);
+  removeNonReleaseButtons(placementsAfterMove);
   let paletteChildElementCount = palette.childElementCount;
   simulateItemDrag(editControls, palette);
   assertAreaPlacements(CustomizableUI.AREA_PANEL, placementsAfterMove);
   is(paletteChildElementCount + 1, palette.childElementCount,
      "The palette should have a new child, congratulations!");
   is(editControls.parentNode.id, "wrapper-edit-controls",
      "The edit-controls should be properly wrapped.");
   is(editControls.parentNode.getAttribute("place"), "palette",
@@ -401,42 +419,44 @@ add_task(function*() {
 // should append the edit-controls to the bottom of the panel.
 add_task(function*() {
   yield startCustomizing();
   let editControls = document.getElementById("edit-controls");
   let panel = document.getElementById(CustomizableUI.AREA_PANEL);
   let numPlaceholders = 2;
   for (let i = 0; i < numPlaceholders; i++) {
     // This test relies on there being a specific number of widgets in the
-    // panel. The addition of sync-button screwed this up, so we remove it
-    // here. We should either fix the tests to not rely on the specific layout,
-    // or fix bug 1007910 which would change the placeholder logic in different
-    // ways. Bug 1229236 is for these tests to be smarter.
-    CustomizableUI.removeWidgetFromArea("sync-button");
+    // panel. The addition of sync-button and webcompat-reporter-button screwed
+    // this up, so we remove them here. We should either fix the tests to not
+    // rely on the specific layout, or fix bug 1007910 which would change the
+    // placeholder logic in different ways. Bug 1229236 is for these tests to
+    // be smarter.
+    removeNonOriginalButtons();
     // NB: We can't just iterate over all of the placeholders
     // because each drag-drop action recreates them.
     let placeholder = panel.getElementsByClassName("panel-customization-placeholder")[i];
     let placementsAfterMove = ["zoom-controls",
                                "new-window-button",
                                "privatebrowsing-button",
                                "save-page-button",
                                "print-button",
                                "history-panelmenu",
                                "fullscreen-button",
                                "find-button",
                                "preferences-button",
                                "add-ons-button",
                                "edit-controls",
-                               "developer-button"];
-    removeDeveloperButtonIfDevEdition(placementsAfterMove);
+                               "developer-button",
+                              ];
+    removeNonReleaseButtons(placementsAfterMove);
     simulateItemDrag(editControls, placeholder);
     assertAreaPlacements(CustomizableUI.AREA_PANEL, placementsAfterMove);
     let zoomControls = document.getElementById("zoom-controls");
     simulateItemDrag(editControls, zoomControls);
-    CustomizableUI.addWidgetToArea("sync-button", CustomizableUI.AREA_PANEL);
+    restoreNonOriginalButtons();
     ok(CustomizableUI.inDefaultState, "Should still be in default state.");
   }
 });
 
 // Dragging the open-file-button back on to itself should work.
 add_task(function*() {
   yield startCustomizing();
   let openFileButton = document.getElementById("open-file-button");
@@ -449,49 +469,51 @@ add_task(function*() {
   is(editControls.parentNode.tagName, "toolbarpaletteitem",
      "edit-controls should be wrapped by a toolbarpaletteitem");
   ok(CustomizableUI.inDefaultState, "Should still be in default state.");
 });
 
 // Dragging a small button onto the last big button should work.
 add_task(function*() {
   // Bug 1007910 requires there be a placeholder on the final row for this
-  // test to work as written. The addition of sync-button meant that's not true
-  // so we remove it from here. Bug 1229236 is for these tests to be smarter.
-  CustomizableUI.removeWidgetFromArea("sync-button");
+  // test to work as written. The addition of sync-button and
+  // webcompat-reporter-button meant that's not true so we remove them from
+  // here. Bug 1229236 is for these tests to be smarter.
+  removeNonOriginalButtons();
   yield startCustomizing();
   let editControls = document.getElementById("edit-controls");
   let panel = document.getElementById(CustomizableUI.AREA_PANEL);
   let target = panel.getElementsByClassName("panel-customization-placeholder")[0];
   let placementsAfterMove = ["zoom-controls",
                              "new-window-button",
                              "privatebrowsing-button",
                              "save-page-button",
                              "print-button",
                              "history-panelmenu",
                              "fullscreen-button",
                              "find-button",
                              "preferences-button",
                              "add-ons-button",
                              "edit-controls",
-                             "developer-button"];
-  removeDeveloperButtonIfDevEdition(placementsAfterMove);
+                             "developer-button",
+                            ];
+  removeNonReleaseButtons(placementsAfterMove);
   simulateItemDrag(editControls, target);
   assertAreaPlacements(CustomizableUI.AREA_PANEL, placementsAfterMove);
   let itemToDrag = "email-link-button"; // any button in the palette by default.
   let button = document.getElementById(itemToDrag);
   placementsAfterMove.splice(11, 0, itemToDrag);
   simulateItemDrag(button, editControls);
   assertAreaPlacements(CustomizableUI.AREA_PANEL, placementsAfterMove);
 
   // Put stuff back:
   let palette = document.getElementById("customization-palette");
   let zoomControls = document.getElementById("zoom-controls");
   simulateItemDrag(button, palette);
   simulateItemDrag(editControls, zoomControls);
-  CustomizableUI.addWidgetToArea("sync-button", CustomizableUI.AREA_PANEL);
+  restoreNonOriginalButtons();
   ok(CustomizableUI.inDefaultState, "Should be in default state again.");
 });
 
 add_task(function* asyncCleanup() {
   yield endCustomizing();
   yield resetCustomization();
 });
--- a/browser/components/customizableui/test/browser_890140_orphaned_placeholders.js
+++ b/browser/components/customizableui/test/browser_890140_orphaned_placeholders.js
@@ -16,47 +16,47 @@ add_task(function*() {
   }
   if (!isInDevEdition()) {
     ok(CustomizableUI.inDefaultState, "Should be in default state.");
   } else {
     ok(!CustomizableUI.inDefaultState, "Should not be in default state if on DevEdition.");
   }
 
   // This test relies on an exact number of widgets being in the panel.
-  // Remove the sync-button to satisfy that. (bug 1229236)
-  CustomizableUI.removeWidgetFromArea("sync-button");
+  // Remove the buttons to satisfy that. (bug 1229236)
+  removeNonOriginalButtons();
   let panel = document.getElementById(CustomizableUI.AREA_PANEL);
   let placements = getAreaWidgetIds(CustomizableUI.AREA_PANEL);
 
   assertAreaPlacements(CustomizableUI.AREA_PANEL, placements);
   is(getVisiblePlaceholderCount(panel), 2, "Should only have 2 visible placeholders before exiting");
 
   yield endCustomizing();
   yield startCustomizing();
   is(getVisiblePlaceholderCount(panel), 2, "Should only have 2 visible placeholders after re-entering");
 
   if (isInDevEdition()) {
     CustomizableUI.addWidgetToArea("developer-button", CustomizableUI.AREA_NAVBAR, 2);
   }
 
-  CustomizableUI.addWidgetToArea("sync-button", CustomizableUI.AREA_PANEL);
+  restoreNonOriginalButtons();
   ok(CustomizableUI.inDefaultState, "Should be in default state again.");
 });
 
 // Two orphaned items should have one placeholder next to them (case 1).
 add_task(function*() {
   yield startCustomizing();
 
   if (isInDevEdition()) {
     CustomizableUI.addWidgetToArea("developer-button", CustomizableUI.AREA_PANEL);
   }
 
   // This test relies on an exact number of widgets being in the panel.
-  // Remove the sync-button to satisfy that. (bug 1229236)
-  CustomizableUI.removeWidgetFromArea("sync-button");
+  // Remove the button to satisfy that. (bug 1229236)
+  removeNonOriginalButtons()
 
   let btn = document.getElementById("open-file-button");
   let panel = document.getElementById(CustomizableUI.AREA_PANEL);
   let placements = getAreaWidgetIds(CustomizableUI.AREA_PANEL);
   let placementsAfterAppend = placements;
 
   placementsAfterAppend = placements.concat(["open-file-button"]);
   simulateItemDrag(btn, panel);
@@ -76,30 +76,30 @@ add_task(function*() {
 
   btn = document.getElementById("open-file-button");
   simulateItemDrag(btn, palette);
 
   if (isInDevEdition()) {
     CustomizableUI.addWidgetToArea("developer-button", CustomizableUI.AREA_NAVBAR, 2);
   }
 
-  CustomizableUI.addWidgetToArea("sync-button", CustomizableUI.AREA_PANEL);
+  restoreNonOriginalButtons();
   ok(CustomizableUI.inDefaultState, "Should be in default state again.");
 });
 
 // Two orphaned items should have one placeholder next to them (case 2).
 add_task(function*() {
   yield startCustomizing();
 
   if (isInDevEdition()) {
     CustomizableUI.addWidgetToArea("developer-button", CustomizableUI.AREA_PANEL);
   }
   // This test relies on an exact number of widgets being in the panel.
-  // Remove the sync-button to satisfy that. (bug 1229236)
-  CustomizableUI.removeWidgetFromArea("sync-button");
+  // Remove the buttons to satisfy that. (bug 1229236)
+  removeNonOriginalButtons();
 
   let btn = document.getElementById("add-ons-button");
   let btn2 = document.getElementById("developer-button");
   let panel = document.getElementById(CustomizableUI.AREA_PANEL);
   let palette = document.getElementById("customization-palette");
   let placements = getAreaWidgetIds(CustomizableUI.AREA_PANEL);
 
   let placementsAfterAppend = placements.filter(p => p != btn.id && p != btn2.id);
@@ -118,31 +118,31 @@ add_task(function*() {
   simulateItemDrag(btn2, panel);
 
   assertAreaPlacements(CustomizableUI.AREA_PANEL, placements);
 
   if (isInDevEdition()) {
     CustomizableUI.addWidgetToArea("developer-button", CustomizableUI.AREA_NAVBAR, 2);
   }
 
-  CustomizableUI.addWidgetToArea("sync-button", CustomizableUI.AREA_PANEL);
+  restoreNonOriginalButtons();
   ok(CustomizableUI.inDefaultState, "Should be in default state again.");
 });
 
 // A wide widget at the bottom of the panel should have three placeholders after it.
 add_task(function*() {
   yield startCustomizing();
 
   if (isInDevEdition()) {
     CustomizableUI.addWidgetToArea("developer-button", CustomizableUI.AREA_PANEL);
   }
 
   // This test relies on an exact number of widgets being in the panel.
-  // Remove the sync-button to satisfy that. (bug 1229236)
-  CustomizableUI.removeWidgetFromArea("sync-button");
+  // Remove the buttons to satisfy that. (bug 1229236)
+  removeNonOriginalButtons();
 
   let btn = document.getElementById("edit-controls");
   let btn2 = document.getElementById("developer-button");
   let panel = document.getElementById(CustomizableUI.AREA_PANEL);
   let palette = document.getElementById("customization-palette");
   let placements = getAreaWidgetIds(CustomizableUI.AREA_PANEL);
 
   placements.pop();
@@ -162,17 +162,17 @@ add_task(function*() {
 
   let zoomControls = document.getElementById("zoom-controls");
   simulateItemDrag(btn, zoomControls);
 
   if (isInDevEdition()) {
     CustomizableUI.addWidgetToArea("developer-button", CustomizableUI.AREA_NAVBAR, 2);
   }
 
-  CustomizableUI.addWidgetToArea("sync-button", CustomizableUI.AREA_PANEL);
+  restoreNonOriginalButtons();
   ok(CustomizableUI.inDefaultState, "Should be in default state again.");
 });
 
 // The default placements should have two placeholders at the bottom (or 1 in win8).
 add_task(function*() {
   yield startCustomizing();
   let numPlaceholders = -1;
 
@@ -181,26 +181,26 @@ add_task(function*() {
   } else {
     numPlaceholders = 2;
   }
 
   let panel = document.getElementById(CustomizableUI.AREA_PANEL);
   ok(CustomizableUI.inDefaultState, "Should be in default state.");
 
   // This test relies on an exact number of widgets being in the panel.
-  // Remove the sync-button to satisfy that. (bug 1229236)
-  CustomizableUI.removeWidgetFromArea("sync-button");
+  // Remove the buttons to satisfy that. (bug 1229236)
+  removeNonOriginalButtons();
 
   is(getVisiblePlaceholderCount(panel), numPlaceholders, "Should have " + numPlaceholders + " visible placeholders before exiting");
 
   yield endCustomizing();
   yield startCustomizing();
   is(getVisiblePlaceholderCount(panel), numPlaceholders, "Should have " + numPlaceholders + " visible placeholders after re-entering");
 
-  CustomizableUI.addWidgetToArea("sync-button", CustomizableUI.AREA_PANEL);
+  restoreNonOriginalButtons();
   ok(CustomizableUI.inDefaultState, "Should still be in default state.");
 });
 
 add_task(function* asyncCleanup() {
   yield endCustomizing();
   yield resetCustomization();
 });
 
--- a/browser/components/customizableui/test/browser_967000_button_sync.js
+++ b/browser/components/customizableui/test/browser_967000_button_sync.js
@@ -57,19 +57,16 @@ add_task(function* setup() {
   });
 });
 
 // The test expects the about:preferences#sync page to open in the current tab
 function* openPrefsFromMenuPanel(expectedPanelId, entryPoint) {
   info("Check Sync button functionality");
   Services.prefs.setCharPref("identity.fxaccounts.remote.signup.uri", "http://example.com/");
 
-  // add the Sync button to the panel
-  CustomizableUI.addWidgetToArea("sync-button", CustomizableUI.AREA_PANEL);
-
   // check the button's functionality
   yield PanelUI.show();
 
   if (entryPoint == "uitour") {
     UITour.tourBrowsersByWindow.set(window, new Set());
     UITour.tourBrowsersByWindow.get(window).add(gBrowser.selectedBrowser);
   }
 
@@ -147,18 +144,16 @@ add_task(function* () {
 
   mockedInternal.getTabClients = () => [];
   mockedInternal.syncTabs = () => Promise.resolve();
 
   document.getElementById("sync-reauth-state").hidden = true;
   document.getElementById("sync-setup-state").hidden = true;
   document.getElementById("sync-syncnow-state").hidden = false;
 
-  CustomizableUI.addWidgetToArea("sync-button", CustomizableUI.AREA_PANEL);
-
   let syncPanel = document.getElementById("PanelUI-remotetabs");
   let links = syncPanel.querySelectorAll(".remotetabs-promo-link");
 
   is(links.length, 2, "found 2 links as expected");
 
   // test each link and left and middle mouse buttons
   for (let link of links) {
     for (let button = 0; button < 2; button++) {
@@ -209,18 +204,16 @@ add_task(function* () {
     return Promise.resolve();
   }
 
   // configure our broadcasters so we are in the right state.
   document.getElementById("sync-reauth-state").hidden = true;
   document.getElementById("sync-setup-state").hidden = true;
   document.getElementById("sync-syncnow-state").hidden = false;
 
-  // add the Sync button to the panel
-  CustomizableUI.addWidgetToArea("sync-button", CustomizableUI.AREA_PANEL);
   yield PanelUI.show();
   document.getElementById("sync-button").click();
   let syncPanel = document.getElementById("PanelUI-remotetabs");
   ok(syncPanel.getAttribute("current"), "Sync Panel is in view");
 
   let subpanel = document.getElementById("PanelUI-remotetabs-main")
   ok(!subpanel.hidden, "main pane is visible");
   let deck = document.getElementById("PanelUI-remotetabs-deck");
--- a/browser/components/customizableui/test/head.js
+++ b/browser/components/customizableui/test/head.js
@@ -113,20 +113,42 @@ function getToolboxCustomToolbarId(toolb
 function resetCustomization() {
   return CustomizableUI.reset();
 }
 
 function isInDevEdition() {
   return AppConstants.MOZ_DEV_EDITION;
 }
 
-function removeDeveloperButtonIfDevEdition(areaPanelPlacements) {
+function isInNightly() {
+  return AppConstants.NIGHTLY_BUILD;
+}
+
+function removeNonReleaseButtons(areaPanelPlacements) {
   if (isInDevEdition()) {
     areaPanelPlacements.splice(areaPanelPlacements.indexOf("developer-button"), 1);
   }
+
+  if (!isInNightly()) {
+    areaPanelPlacements.splice(areaPanelPlacements.indexOf("webcompat-reporter-button"), 1);
+  }
+}
+
+function removeNonOriginalButtons() {
+  CustomizableUI.removeWidgetFromArea("sync-button");
+  if (isInNightly()) {
+    CustomizableUI.removeWidgetFromArea("webcompat-reporter-button");
+  }
+}
+
+function restoreNonOriginalButtons() {
+  CustomizableUI.addWidgetToArea("sync-button", CustomizableUI.AREA_PANEL);
+  if (isInNightly()) {
+    CustomizableUI.addWidgetToArea("webcompat-reporter-button", CustomizableUI.AREA_PANEL);
+  }
 }
 
 function assertAreaPlacements(areaId, expectedPlacements) {
   let actualPlacements = getAreaWidgetIds(areaId);
   placementArraysEqual(areaId, actualPlacements, expectedPlacements);
 }
 
 function placementArraysEqual(areaId, actualPlacements, expectedPlacements) {