Bug 941002 - [Australis] Add Developer Tools button to menu default set. r=Unfocused
☠☠ backed out by 897a8d1df4f7 ☠ ☠
authorJared Wein <jwein@mozilla.com>
Tue, 17 Dec 2013 21:11:59 -0500
changeset 161000 fc79fa2fd2e368403ec3bd2a299063324acdfb92
parent 160999 20c8bcc72b5f3a8c13cced5ab11384392d7ed47a
child 161001 336da7d0b51aab4f6374d404a10fb43979266732
push id3372
push usercbook@mozilla.com
push dateWed, 18 Dec 2013 12:06:28 +0000
treeherderb2g-inbound@0758d09c0962 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersUnfocused
bugs941002
milestone29.0a1
Bug 941002 - [Australis] Add Developer Tools button to menu default set. r=Unfocused
browser/components/customizableui/src/CustomizableUI.jsm
browser/components/customizableui/test/browser_876944_customize_mode_create_destroy.js
browser/components/customizableui/test/browser_878452_drag_to_panel.js
browser/components/customizableui/test/browser_880382_drag_wide_widgets_in_panel.js
browser/components/customizableui/test/browser_890140_orphaned_placeholders.js
--- a/browser/components/customizableui/src/CustomizableUI.jsm
+++ b/browser/components/customizableui/src/CustomizableUI.jsm
@@ -145,17 +145,18 @@ let CustomizableUIInternal = {
       "new-window-button",
       "privatebrowsing-button",
       "save-page-button",
       "print-button",
       "history-panelmenu",
       "fullscreen-button",
       "find-button",
       "preferences-button",
-      "add-ons-button"
+      "add-ons-button",
+      "developer-button",
     ];
 
     if (gPalette.has("switch-to-metro-button")) {
       panelPlacements.push("switch-to-metro-button");
     }
 
     let showCharacterEncoding = Services.prefs.getComplexValue(
       "browser.menu.showCharacterEncoding",
--- a/browser/components/customizableui/test/browser_876944_customize_mode_create_destroy.js
+++ b/browser/components/customizableui/test/browser_876944_customize_mode_create_destroy.js
@@ -22,25 +22,25 @@ add_task(function testWrapUnwrap() {
   ok(!wrapper, "There should be a wrapper");
   let item = document.getElementById(kTestWidget1);
   ok(!item, "There should no longer be an item");
 });
 
 // Creating and destroying a widget should correctly deal with panel placeholders
 add_task(function testPanelPlaceholders() {
   let panel = document.getElementById(CustomizableUI.AREA_PANEL);
-  is(panel.querySelectorAll(".panel-customization-placeholder").length, isInWin8() ? 2 : 3, "The number of placeholders should be correct.");
+  is(panel.querySelectorAll(".panel-customization-placeholder").length, isInWin8() ? 1 : 2, "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");
-  is(panel.querySelectorAll(".panel-customization-placeholder").length, isInWin8() ? 1 : 2, "The number of placeholders should be correct.");
+  is(panel.querySelectorAll(".panel-customization-placeholder").length, isInWin8() ? 3 : 1, "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_878452_drag_to_panel.js
+++ b/browser/components/customizableui/test/browser_878452_drag_to_panel.js
@@ -4,61 +4,61 @@
 
 "use strict";
 
 Services.prefs.setBoolPref("browser.uiCustomization.skipSourceNodeCheck", true);
 
 // Dragging an item from the palette to another button in the panel should work.
 add_task(function() {
   yield startCustomizing();
-  let btn = document.getElementById("developer-button");
+  let btn = document.getElementById("feed-button");
   let panel = document.getElementById(CustomizableUI.AREA_PANEL);
   let placements = getAreaWidgetIds(CustomizableUI.AREA_PANEL);
 
   let lastButtonIndex = placements.length - 1;
   let lastButton = placements[lastButtonIndex];
-  let placementsAfterInsert = placements.slice(0, lastButtonIndex).concat(["developer-button", lastButton]);
+  let placementsAfterInsert = placements.slice(0, lastButtonIndex).concat(["feed-button", lastButton]);
   let lastButtonNode = document.getElementById(lastButton);
   simulateItemDrag(btn, lastButtonNode);
   assertAreaPlacements(CustomizableUI.AREA_PANEL, placementsAfterInsert);
   ok(!CustomizableUI.inDefaultState, "Should no longer be in default state.");
   let palette = document.getElementById("customization-palette");
   simulateItemDrag(btn, palette);
   ok(CustomizableUI.inDefaultState, "Should be in default state again.");
 });
 
 // Dragging an item from the palette to the panel itself should also work.
 add_task(function() {
   yield startCustomizing();
-  let btn = document.getElementById("developer-button");
+  let btn = document.getElementById("feed-button");
   let panel = document.getElementById(CustomizableUI.AREA_PANEL);
   let placements = getAreaWidgetIds(CustomizableUI.AREA_PANEL);
 
-  let placementsAfterAppend = placements.concat(["developer-button"]);
+  let placementsAfterAppend = placements.concat(["feed-button"]);
   simulateItemDrag(btn, panel);
   assertAreaPlacements(CustomizableUI.AREA_PANEL, placementsAfterAppend);
   ok(!CustomizableUI.inDefaultState, "Should no longer be in default state.");
   let palette = document.getElementById("customization-palette");
   simulateItemDrag(btn, palette);
   ok(CustomizableUI.inDefaultState, "Should be in default state again.");
 });
 
 // Dragging an item from the palette to an empty panel should also work.
 add_task(function() {
   let widgetIds = getAreaWidgetIds(CustomizableUI.AREA_PANEL);
   while (widgetIds.length) {
     CustomizableUI.removeWidgetFromArea(widgetIds.shift());
   }
   yield startCustomizing();
-  let btn = document.getElementById("developer-button");
+  let btn = document.getElementById("feed-button");
   let panel = document.getElementById(CustomizableUI.AREA_PANEL);
 
   assertAreaPlacements(panel.id, []);
 
-  let placementsAfterAppend = ["developer-button"];
+  let placementsAfterAppend = ["feed-button"];
   simulateItemDrag(btn, panel);
   assertAreaPlacements(CustomizableUI.AREA_PANEL, placementsAfterAppend);
   ok(!CustomizableUI.inDefaultState, "Should no longer be in default state.");
   let palette = document.getElementById("customization-palette");
   simulateItemDrag(btn, palette);
   assertAreaPlacements(panel.id, []);
 });
 
--- 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
@@ -17,17 +17,18 @@ add_task(function() {
                              "privatebrowsing-button",
                              "save-page-button",
                              "zoom-controls",
                              "print-button",
                              "history-panelmenu",
                              "fullscreen-button",
                              "find-button",
                              "preferences-button",
-                             "add-ons-button"];
+                             "add-ons-button",
+                             "developer-button"];
   addSwitchToMetroButtonInWindows8(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.");
 });
@@ -42,17 +43,18 @@ add_task(function() {
                              "new-window-button",
                              "privatebrowsing-button",
                              "save-page-button",
                              "print-button",
                              "history-panelmenu",
                              "fullscreen-button",
                              "find-button",
                              "preferences-button",
-                             "add-ons-button"];
+                             "add-ons-button",
+                             "developer-button"];
   addSwitchToMetroButtonInWindows8(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.
@@ -65,17 +67,18 @@ add_task(function() {
                              "new-window-button",
                              "privatebrowsing-button",
                              "save-page-button",
                              "print-button",
                              "history-panelmenu",
                              "fullscreen-button",
                              "find-button",
                              "preferences-button",
-                             "add-ons-button"];
+                             "add-ons-button",
+                             "developer-button"];
   addSwitchToMetroButtonInWindows8(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() {
@@ -87,17 +90,18 @@ add_task(function() {
                              "privatebrowsing-button",
                              "save-page-button",
                              "zoom-controls",
                              "print-button",
                              "history-panelmenu",
                              "fullscreen-button",
                              "find-button",
                              "preferences-button",
-                             "add-ons-button"];
+                             "add-ons-button",
+                             "developer-button"];
   addSwitchToMetroButtonInWindows8(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.");
 });
@@ -113,96 +117,99 @@ add_task(function() {
                              "privatebrowsing-button",
                              "save-page-button",
                              "print-button",
                              "history-panelmenu",
                              "fullscreen-button",
                              "zoom-controls",
                              "find-button",
                              "preferences-button",
-                             "add-ons-button"];
+                             "add-ons-button",
+                             "developer-button"];
   addSwitchToMetroButtonInWindows8(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.");
 });
 
 // Dragging an item from the palette to before the zoom-controls should move it and two other buttons before the zoom controls.
 add_task(function() {
   yield startCustomizing();
-  let developerButton = document.getElementById("developer-button");
+  let openFileButton = document.getElementById("open-file-button");
   let zoomControls = document.getElementById("zoom-controls");
   let placementsAfterInsert = ["edit-controls",
-                               "developer-button",
+                               "open-file-button",
                                "new-window-button",
                                "privatebrowsing-button",
                                "zoom-controls",
                                "save-page-button",
                                "print-button",
                                "history-panelmenu",
                                "fullscreen-button",
                                "find-button",
                                "preferences-button",
-                               "add-ons-button"];
+                               "add-ons-button",
+                               "developer-button"];
   addSwitchToMetroButtonInWindows8(placementsAfterInsert);
-  simulateItemDrag(developerButton, zoomControls);
+  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,
      "feed-button should be a child of wrapper-feed-button");
   is(feedWrapper.getAttribute("place"), "palette",
      "The feed-button wrapper should have it's place set to 'palette'");
-  simulateItemDrag(developerButton, palette);
-  is(developerButton.parentNode.tagName, "toolbarpaletteitem",
-     "The developer-button should be wrapped by a toolbarpaletteitem");
+  simulateItemDrag(openFileButton, palette);
+  is(openFileButton.parentNode.tagName, "toolbarpaletteitem",
+     "The open-file-button should be wrapped by a toolbarpaletteitem");
   let newWindowButton = document.getElementById("new-window-button");
   simulateItemDrag(zoomControls, newWindowButton);
   ok(CustomizableUI.inDefaultState, "Should be in default state again.");
 });
 
 // Dragging an item from the palette to before the edit-controls
 // should move it and two other buttons before the edit and zoom controls.
 add_task(function() {
   yield startCustomizing();
-  let developerButton = document.getElementById("developer-button");
+  let openFileButton = document.getElementById("open-file-button");
   let editControls = document.getElementById("edit-controls");
-  let placementsAfterInsert = ["developer-button",
+  let placementsAfterInsert = ["open-file-button",
                                "new-window-button",
                                "privatebrowsing-button",
                                "edit-controls",
                                "zoom-controls",
                                "save-page-button",
                                "print-button",
                                "history-panelmenu",
                                "fullscreen-button",
                                "find-button",
                                "preferences-button",
-                               "add-ons-button"];
+                               "add-ons-button",
+                               "developer-button"];
   addSwitchToMetroButtonInWindows8(placementsAfterInsert);
-  simulateItemDrag(developerButton, editControls);
+  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,
      "feed-button should be a child of wrapper-feed-button");
   is(feedWrapper.getAttribute("place"), "palette",
      "The feed-button wrapper should have it's place set to 'palette'");
-  simulateItemDrag(developerButton, palette);
-  is(developerButton.parentNode.tagName, "toolbarpaletteitem",
-     "The developer-button should be wrapped by a toolbarpaletteitem");
+  simulateItemDrag(openFileButton, palette);
+  is(openFileButton.parentNode.tagName, "toolbarpaletteitem",
+     "The open-file-button should be wrapped by a toolbarpaletteitem");
   ok(CustomizableUI.inDefaultState, "Should be in default state again.");
 });
 
 // Dragging the edit-controls to be before the zoom-controls button
 // should not move any widgets.
 add_task(function() {
   yield startCustomizing();
   let editControls = document.getElementById("edit-controls");
@@ -212,17 +219,18 @@ add_task(function() {
                              "new-window-button",
                              "privatebrowsing-button",
                              "save-page-button",
                              "print-button",
                              "history-panelmenu",
                              "fullscreen-button",
                              "find-button",
                              "preferences-button",
-                             "add-ons-button"];
+                             "add-ons-button",
+                             "developer-button"];
   addSwitchToMetroButtonInWindows8(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.
@@ -235,17 +243,18 @@ add_task(function() {
                              "new-window-button",
                              "privatebrowsing-button",
                              "save-page-button",
                              "print-button",
                              "history-panelmenu",
                              "fullscreen-button",
                              "find-button",
                              "preferences-button",
-                             "add-ons-button"];
+                             "add-ons-button",
+                             "developer-button"];
   addSwitchToMetroButtonInWindows8(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.");
 });
 
@@ -261,17 +270,18 @@ add_task(function() {
                              "new-window-button",
                              "privatebrowsing-button",
                              "save-page-button",
                              "print-button",
                              "history-panelmenu",
                              "fullscreen-button",
                              "find-button",
                              "preferences-button",
-                             "add-ons-button"];
+                             "add-ons-button",
+                             "developer-button"];
   addSwitchToMetroButtonInWindows8(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.");
 });
 
@@ -287,17 +297,18 @@ add_task(function() {
                              "new-window-button",
                              "privatebrowsing-button",
                              "save-page-button",
                              "print-button",
                              "history-panelmenu",
                              "fullscreen-button",
                              "find-button",
                              "preferences-button",
-                             "add-ons-button"];
+                             "add-ons-button",
+                             "developer-button"];
   addSwitchToMetroButtonInWindows8(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.");
 });
 
@@ -312,17 +323,18 @@ add_task(function() {
                              "privatebrowsing-button",
                              "save-page-button",
                              "print-button",
                              "history-panelmenu",
                              "fullscreen-button",
                              "find-button",
                              "preferences-button",
                              "add-ons-button",
-                             "edit-controls"];
+                             "edit-controls",
+                             "developer-button"];
   addSwitchToMetroButtonInWindows8(placementsAfterMove);
   simulateItemDrag(editControls, panel);
   assertAreaPlacements(CustomizableUI.AREA_PANEL, placementsAfterMove);
   let zoomControls = document.getElementById("zoom-controls");
   simulateItemDrag(editControls, zoomControls);
   ok(CustomizableUI.inDefaultState, "Should still be in default state.");
 });
 
@@ -336,17 +348,18 @@ add_task(function() {
                              "new-window-button",
                              "privatebrowsing-button",
                              "save-page-button",
                              "print-button",
                              "history-panelmenu",
                              "fullscreen-button",
                              "find-button",
                              "preferences-button",
-                             "add-ons-button"];
+                             "add-ons-button",
+                             "developer-button"];
   addSwitchToMetroButtonInWindows8(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.");
@@ -360,50 +373,51 @@ add_task(function() {
 });
 
 // Dragging the edit-controls to each of the panel placeholders
 // 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 = isInWin8() ? 2 : 3;
+  let numPlaceholders = isInWin8() ? 1 : 2;
   for (let i = 0; i < numPlaceholders; i++) {
     // 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"];
+                               "edit-controls",
+                               "developer-button"];
     addSwitchToMetroButtonInWindows8(placementsAfterMove);
     simulateItemDrag(editControls, placeholder);
     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 developer-button back on to itself should work.
+// Dragging the open-file-button back on to itself should work.
 add_task(function() {
   yield startCustomizing();
-  let developerButton = document.getElementById("developer-button");
-  is(developerButton.parentNode.tagName, "toolbarpaletteitem",
-     "developer-button should be wrapped by a toolbarpaletteitem");
-  simulateItemDrag(developerButton, developerButton);
-  is(developerButton.parentNode.tagName, "toolbarpaletteitem",
-     "developer-button should be wrapped by a toolbarpaletteitem");
+  let openFileButton = document.getElementById("open-file-button");
+  is(openFileButton.parentNode.tagName, "toolbarpaletteitem",
+     "open-file-button should be wrapped by a toolbarpaletteitem");
+  simulateItemDrag(openFileButton, openFileButton);
+  is(openFileButton.parentNode.tagName, "toolbarpaletteitem",
+     "open-file-button should be wrapped by a toolbarpaletteitem");
   let editControls = document.getElementById("edit-controls");
   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() {
@@ -416,27 +430,24 @@ add_task(function() {
                              "privatebrowsing-button",
                              "save-page-button",
                              "print-button",
                              "history-panelmenu",
                              "fullscreen-button",
                              "find-button",
                              "preferences-button",
                              "add-ons-button",
-                             "edit-controls"];
+                             "edit-controls",
+                             "developer-button"];
   addSwitchToMetroButtonInWindows8(placementsAfterMove);
   simulateItemDrag(editControls, target);
   assertAreaPlacements(CustomizableUI.AREA_PANEL, placementsAfterMove);
   let itemToDrag = "sync-button";
   let button = document.getElementById(itemToDrag);
-  if (!isInWin8()) {
-    placementsAfterMove.push(itemToDrag);
-  } else {
-    placementsAfterMove.splice(11, 0, 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);
--- a/browser/components/customizableui/test/browser_890140_orphaned_placeholders.js
+++ b/browser/components/customizableui/test/browser_890140_orphaned_placeholders.js
@@ -4,148 +4,152 @@
 
 "use strict";
 
 Services.prefs.setBoolPref("browser.uiCustomization.skipSourceNodeCheck", true);
 
 // One orphaned item should have two placeholders next to it.
 add_task(function() {
   yield startCustomizing();
-  let btn = document.getElementById("developer-button");
+  let btn = document.getElementById("open-file-button");
   let panel = document.getElementById(CustomizableUI.AREA_PANEL);
   let placements = getAreaWidgetIds(CustomizableUI.AREA_PANEL);
 
-  if (!isInWin8()) {
-    placements = placements.concat(["developer-button"]);
-    simulateItemDrag(btn, panel);
+  if (isInWin8()) {
+    CustomizableUI.removeWidgetFromArea("switch-to-metro-button");
+    placements = getAreaWidgetIds(CustomizableUI.AREA_PANEL);
     ok(!CustomizableUI.inDefaultState, "Should no longer be in default state.");
   } else {
     ok(CustomizableUI.inDefaultState, "Should be in default state.");
   }
 
   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 (!isInWin8()) {
-    let palette = document.getElementById("customization-palette");
-    simulateItemDrag(btn, palette);
+  if (isInWin8()) {
+    CustomizableUI.addWidgetToArea("switch-to-metro-button", CustomizableUI.AREA_PANEL);
   }
   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();
-  let btn = document.getElementById("developer-button");
+  let btn = document.getElementById("open-file-button");
   let panel = document.getElementById(CustomizableUI.AREA_PANEL);
   let placements = getAreaWidgetIds(CustomizableUI.AREA_PANEL);
 
-  let placementsAfterAppend = placements.concat(["developer-button"]);
-  simulateItemDrag(btn, panel);
+  let placementsAfterAppend = placements;
 
   if (!isInWin8()) {
-    placementsAfterAppend = placementsAfterAppend.concat(["sync-button"]);
-    btn = document.getElementById("sync-button");
+    placementsAfterAppend = placements.concat(["open-file-button"]);
     simulateItemDrag(btn, panel);
   }
 
   assertAreaPlacements(CustomizableUI.AREA_PANEL, placementsAfterAppend);
   ok(!CustomizableUI.inDefaultState, "Should no longer be in default state.");
-  is(getVisiblePlaceholderCount(panel), 1, "Should only have 1 visible placeholders before exiting");
+  is(getVisiblePlaceholderCount(panel), 1, "Should only have 1 visible placeholder before exiting");
 
   yield endCustomizing();
   yield startCustomizing();
-  is(getVisiblePlaceholderCount(panel), 1, "Should only have 1 visible placeholders after re-entering");
+  is(getVisiblePlaceholderCount(panel), 1, "Should only have 1 visible placeholder after re-entering");
 
   let palette = document.getElementById("customization-palette");
   simulateItemDrag(btn, palette);
 
   if (!isInWin8()) {
-    btn = document.getElementById("developer-button");
+    btn = document.getElementById("open-file-button");
     simulateItemDrag(btn, palette);
   }
   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();
   let btn = document.getElementById("add-ons-button");
-  let btn2 = document.getElementById("switch-to-metro-button");
+  let btn2 = document.getElementById("developer-button");
+  let btn3 = document.getElementById("switch-to-metro-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);
+  let placementsAfterAppend = placements.filter(p => p != btn.id && p != btn2.id);
   simulateItemDrag(btn, palette);
+  simulateItemDrag(btn2, palette);
 
   if (isInWin8()) {
-    placementsAfterAppend = placementsAfterAppend.filter(p => p != btn2.id);
-    simulateItemDrag(btn2, palette);
+    placementsAfterAppend = placementsAfterAppend.filter(p => p != btn3.id);
+    simulateItemDrag(btn3, palette);
   }
 
   assertAreaPlacements(CustomizableUI.AREA_PANEL, placementsAfterAppend);
   ok(!CustomizableUI.inDefaultState, "Should no longer be in default state.");
-  is(getVisiblePlaceholderCount(panel), 1, "Should only have 1 visible placeholders before exiting");
+  is(getVisiblePlaceholderCount(panel), 1, "Should only have 1 visible placeholder before exiting");
 
   yield endCustomizing();
   yield startCustomizing();
-  is(getVisiblePlaceholderCount(panel), 1, "Should only have 1 visible placeholders after re-entering");
+  is(getVisiblePlaceholderCount(panel), 1, "Should only have 1 visible placeholder after re-entering");
 
   simulateItemDrag(btn, panel);
+  simulateItemDrag(btn2, panel);
 
   if (isInWin8()) {
-    simulateItemDrag(btn2, panel);
+    simulateItemDrag(btn3, panel);
   }
 
   assertAreaPlacements(CustomizableUI.AREA_PANEL, placements);
   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();
   let btn = document.getElementById("edit-controls");
+  let developerButton = document.getElementById("developer-button");
   let metroBtn = document.getElementById("switch-to-metro-button");
   let panel = document.getElementById(CustomizableUI.AREA_PANEL);
   let palette = document.getElementById("customization-palette");
   let placements = getAreaWidgetIds(CustomizableUI.AREA_PANEL);
 
+  placements.pop();
+  simulateItemDrag(developerButton, palette);
   if (isInWin8()) {
     // Remove switch-to-metro-button
     placements.pop();
     simulateItemDrag(metroBtn, palette);
   }
 
   let placementsAfterAppend = placements.concat([placements.shift()]);
   simulateItemDrag(btn, panel);
   assertAreaPlacements(CustomizableUI.AREA_PANEL, placementsAfterAppend);
   ok(!CustomizableUI.inDefaultState, "Should no longer be in default state.");
   is(getVisiblePlaceholderCount(panel), 3, "Should have 3 visible placeholders before exiting");
 
   yield endCustomizing();
   yield startCustomizing();
   is(getVisiblePlaceholderCount(panel), 3, "Should have 3 visible placeholders after re-entering");
 
+  simulateItemDrag(developerButton, panel);
   if (isInWin8()) {
     simulateItemDrag(metroBtn, panel);
   }
   let zoomControls = document.getElementById("zoom-controls");
   simulateItemDrag(btn, zoomControls);
   ok(CustomizableUI.inDefaultState, "Should be in default state again.");
 });
 
-// The default placements should have three placeholders at the bottom (or 2 in win8).
+// The default placements should have two placeholders at the bottom (or 1 in win8).
 add_task(function() {
   yield startCustomizing();
-  let numPlaceholders = isInWin8() ? 2 : 3;
+  let numPlaceholders = isInWin8() ? 1 : 2;
   let panel = document.getElementById(CustomizableUI.AREA_PANEL);
   ok(CustomizableUI.inDefaultState, "Should be in default state.");
   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");