Skip to content
Snippets Groups Projects
Commit 1ad503ec authored by Gijs Kruitbosch's avatar Gijs Kruitbosch
Browse files

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

--HG--
extra : rebase_source : 1e5b961e4f0f9f17d0aee3e6cd3aeb1d6bc75741
parent cf5f0b76
No related branches found
No related tags found
No related merge requests found
"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");
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment