Bug 1354117 - update customize mode button state test, r=johannh
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Mon, 31 Jul 2017 21:10:14 +0100
changeset 372891 f6e7d68931d3e1cb00dd2b8e8e8ccf5ecc37b1e8
parent 372890 11a53e10db19204e6f4a33427ef8b02d0e7691ef
child 372892 a8502931b53d010bc63224e4097fa4ba6b3251c6
push id48021
push usergijskruitbosch@gmail.com
push dateFri, 04 Aug 2017 12:09:30 +0000
treeherderautoland@4fb560842d16 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjohannh
bugs1354117
milestone57.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 1354117 - update customize mode button state test, r=johannh Again, this test is mostly useless now, so I would also be fine with just removing it. MozReview-Commit-ID: BwOGQ5pwSQd
browser/components/customizableui/test/browser_customizemode_contextmenu_menubuttonstate.js
--- a/browser/components/customizableui/test/browser_customizemode_contextmenu_menubuttonstate.js
+++ b/browser/components/customizableui/test/browser_customizemode_contextmenu_menubuttonstate.js
@@ -1,25 +1,30 @@
 "use strict";
 
 add_task(async function() {
-  await SpecialPowers.pushPrefEnv({set: [["browser.photon.structure.enabled", false]]});
   ok(!PanelUI.menuButton.hasAttribute("open"), "Menu button should not be 'pressed' outside customize mode");
+  ok(!PanelUI.menuButton.hasAttribute("disabled"), "Menu button should not be disabled outside of customize mode");
   await startCustomizing();
 
-  is(PanelUI.menuButton.getAttribute("open"), "true", "Menu button should be 'pressed' when in customize mode");
+  ok(!PanelUI.menuButton.hasAttribute("open"), "Menu button should still not be 'pressed' when in customize mode");
+  is(PanelUI.menuButton.getAttribute("disabled"), "true", "Menu button should be disabled in customize mode");
 
-  let contextMenu = document.getElementById("customizationPanelItemContextMenu");
+  let contextMenu = document.getElementById("customizationPaletteItemContextMenu");
   let shownPromise = popupShown(contextMenu);
   let newWindowButton = document.getElementById("wrapper-new-window-button");
   EventUtils.synthesizeMouse(newWindowButton, 2, 2, {type: "contextmenu", button: 2});
   await shownPromise;
-  is(PanelUI.menuButton.getAttribute("open"), "true", "Menu button should be 'pressed' when in customize mode after opening a context menu");
+  ok(!PanelUI.menuButton.hasAttribute("open"), "Menu button should still not be 'pressed' when in customize mode after opening a context menu");
+  is(PanelUI.menuButton.getAttribute("disabled"), "true", "Menu button should still be disabled in customize mode");
+  is(PanelUI.menuButton.getAttribute("disabled"), "true", "Menu button should still be disabled in customize mode after opening context menu");
 
   let hiddenContextPromise = popupHidden(contextMenu);
   contextMenu.hidePopup();
   await hiddenContextPromise;
-  is(PanelUI.menuButton.getAttribute("open"), "true", "Menu button should be 'pressed' when in customize mode after hiding a context menu");
+  ok(!PanelUI.menuButton.hasAttribute("open"), "Menu button should still not be 'pressed' when in customize mode after hiding a context menu");
+  is(PanelUI.menuButton.getAttribute("disabled"), "true", "Menu button should still be disabled in customize mode after hiding context menu");
   await endCustomizing();
 
   ok(!PanelUI.menuButton.hasAttribute("open"), "Menu button should not be 'pressed' after ending customize mode");
+  ok(!PanelUI.menuButton.hasAttribute("disabled"), "Menu button should not be disabled after ending customize mode");
 });