зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 8dd76087ff2b (bug 1694817) for causing failures in browser_UITour.js
This commit is contained in:
Родитель
95e1fff568
Коммит
62639374c4
|
@ -10,18 +10,6 @@ function focus_in_navbar() {
|
|||
}
|
||||
|
||||
function test() {
|
||||
if (CustomizableUI.protonToolbarEnabled) {
|
||||
// Put the home button in the pre-proton placement to test focus states.
|
||||
CustomizableUI.addWidgetToArea(
|
||||
"home-button",
|
||||
"nav-bar",
|
||||
CustomizableUI.getPlacementOfWidget("stop-reload-button").position + 1
|
||||
);
|
||||
registerCleanupFunction(async function resetToolbar() {
|
||||
await CustomizableUI.reset();
|
||||
});
|
||||
}
|
||||
|
||||
waitForExplicitFinish();
|
||||
|
||||
tab1 = BrowserTestUtils.addTab(gBrowser, "about:blank", {
|
||||
|
|
|
@ -1,21 +1,6 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
add_task(async function setupHomeButton() {
|
||||
if (CustomizableUI.protonToolbarEnabled) {
|
||||
// Put the home button in the pre-proton placement to test focus states.
|
||||
CustomizableUI.addWidgetToArea(
|
||||
"home-button",
|
||||
"nav-bar",
|
||||
CustomizableUI.getPlacementOfWidget("stop-reload-button").position + 1
|
||||
);
|
||||
CustomizableUI.addWidgetToArea("sidebar-button", "nav-bar");
|
||||
}
|
||||
registerCleanupFunction(async function resetToolbar() {
|
||||
await CustomizableUI.reset();
|
||||
});
|
||||
});
|
||||
|
||||
add_task(async function() {
|
||||
let HOMEPAGE_PREF = "browser.startup.homepage";
|
||||
|
||||
|
|
|
@ -193,8 +193,8 @@ async function drop(dragData, expectedURLs) {
|
|||
|
||||
// Since synthesizeDrop triggers the srcElement, need to use another button
|
||||
// that should be visible.
|
||||
let dragSrcElement = document.getElementById("back-button");
|
||||
ok(dragSrcElement, "Back button exists");
|
||||
let dragSrcElement = document.getElementById("sidebar-button");
|
||||
ok(dragSrcElement, "Sidebar button exists");
|
||||
let newTabButton = document.getElementById(
|
||||
gBrowser.tabContainer.hasAttribute("overflow")
|
||||
? "new-tab-button"
|
||||
|
|
|
@ -39,13 +39,6 @@ add_task(async function test_setup() {
|
|||
CustomizableUI.removeWidgetFromArea("new-window-button");
|
||||
});
|
||||
}
|
||||
|
||||
if (CustomizableUI.protonToolbarEnabled) {
|
||||
CustomizableUI.addWidgetToArea("sidebar-button", "nav-bar");
|
||||
registerCleanupFunction(() =>
|
||||
CustomizableUI.removeWidgetFromArea("sidebar-button")
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
// New Window Button opens any link.
|
||||
|
|
|
@ -60,9 +60,6 @@ add_task(async function testAppMenuButtonWrongKey() {
|
|||
// Test activation of the Library button from the keyboard.
|
||||
// The Library menu should appear and focus should move inside it.
|
||||
add_task(async function testLibraryButtonPress() {
|
||||
if (CustomizableUI.protonToolbarEnabled) {
|
||||
CustomizableUI.addWidgetToArea("library-button", "nav-bar");
|
||||
}
|
||||
let button = document.getElementById("library-button");
|
||||
forceFocus(button);
|
||||
EventUtils.synthesizeKey(" ");
|
||||
|
@ -73,9 +70,6 @@ add_task(async function testLibraryButtonPress() {
|
|||
let hidden = BrowserTestUtils.waitForEvent(document, "popuphidden", true);
|
||||
view.closest("panel").hidePopup();
|
||||
await hidden;
|
||||
if (CustomizableUI.protonToolbarEnabled) {
|
||||
CustomizableUI.removeWidgetFromArea("library-button");
|
||||
}
|
||||
});
|
||||
|
||||
// Test activation of the Developer button from the keyboard.
|
||||
|
@ -202,9 +196,6 @@ add_task(async function testReloadButtonPress() {
|
|||
// Test activation of the Sidebars button from the keyboard.
|
||||
// This is a toolbarbutton with a command handler.
|
||||
add_task(async function testSidebarsButtonPress() {
|
||||
if (CustomizableUI.protonToolbarEnabled) {
|
||||
CustomizableUI.addWidgetToArea("sidebar-button", "nav-bar");
|
||||
}
|
||||
let button = document.getElementById("sidebar-button");
|
||||
ok(!button.checked, "Sidebars button not checked at start of test");
|
||||
let sidebarBox = document.getElementById("sidebar-box");
|
||||
|
@ -225,9 +216,6 @@ add_task(async function testSidebarsButtonPress() {
|
|||
await TestUtils.waitForCondition(() => !button.checked);
|
||||
ok(true, "Sidebars button not checked after press");
|
||||
ok(sidebarBox.hidden, "Sidebar hidden after press");
|
||||
if (CustomizableUI.protonToolbarEnabled) {
|
||||
CustomizableUI.removeWidgetFromArea("sidebar-button");
|
||||
}
|
||||
});
|
||||
|
||||
// Test activation of the Bookmark this page button from the keyboard.
|
||||
|
|
|
@ -11,9 +11,6 @@
|
|||
|
||||
const PERMISSIONS_PAGE =
|
||||
"https://example.com/browser/browser/base/content/test/permissions/permissions.html";
|
||||
const afterUrlBarButton = CustomizableUI.protonToolbarEnabled
|
||||
? "PanelUI-menu-button"
|
||||
: "library-button";
|
||||
|
||||
// The DevEdition has the DevTools button in the toolbar by default. Remove it
|
||||
// to prevent branch-specific rules what button should be focused.
|
||||
|
@ -22,57 +19,6 @@ function resetToolbarWithoutDevEditionButtons() {
|
|||
CustomizableUI.removeWidgetFromArea("developer-button");
|
||||
}
|
||||
|
||||
function maybeAddHomeBesideReload() {
|
||||
if (CustomizableUI.protonToolbarEnabled) {
|
||||
CustomizableUI.addWidgetToArea(
|
||||
"home-button",
|
||||
"nav-bar",
|
||||
CustomizableUI.getPlacementOfWidget("stop-reload-button").position + 1
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
function maybeRemoveHomeButton() {
|
||||
if (CustomizableUI.protonToolbarEnabled) {
|
||||
CustomizableUI.removeWidgetFromArea("home-button");
|
||||
}
|
||||
}
|
||||
|
||||
function maybeAddOldMenuSideButtons() {
|
||||
if (CustomizableUI.protonToolbarEnabled) {
|
||||
// Make the FxA button visible even though we're signed out.
|
||||
// We'll use oldfxastatus to restore the old state.
|
||||
document.documentElement.setAttribute(
|
||||
"oldfxastatus",
|
||||
document.documentElement.getAttribute("fxastatus")
|
||||
);
|
||||
document.documentElement.setAttribute("fxastatus", "signed_in");
|
||||
// The FxA button is supposed to be last, add these buttons before it.
|
||||
CustomizableUI.addWidgetToArea(
|
||||
"library-button",
|
||||
"nav-bar",
|
||||
CustomizableUI.getWidgetIdsInArea("nav-bar").length - 1
|
||||
);
|
||||
CustomizableUI.addWidgetToArea(
|
||||
"sidebar-button",
|
||||
"nav-bar",
|
||||
CustomizableUI.getWidgetIdsInArea("nav-bar").length - 1
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
function maybeRemoveOldMenuSideButtons() {
|
||||
if (CustomizableUI.protonToolbarEnabled) {
|
||||
CustomizableUI.removeWidgetFromArea("library-button");
|
||||
CustomizableUI.removeWidgetFromArea("sidebar-button");
|
||||
document.documentElement.setAttribute(
|
||||
"fxastatus",
|
||||
document.documentElement.getAttribute("oldfxastatus")
|
||||
);
|
||||
document.documentElement.removeAttribute("oldfxastatus");
|
||||
}
|
||||
}
|
||||
|
||||
function startFromUrlBar(aWindow = window) {
|
||||
aWindow.gURLBar.focus();
|
||||
is(
|
||||
|
@ -126,18 +72,16 @@ add_task(async function setup() {
|
|||
});
|
||||
|
||||
// Test tab stops with no page loaded.
|
||||
add_task(async function testTabStopsNoPageWithHomeButton() {
|
||||
maybeAddHomeBesideReload();
|
||||
add_task(async function testTabStopsNoPage() {
|
||||
await withNewBlankTab(async function() {
|
||||
startFromUrlBar();
|
||||
await expectFocusAfterKey("Shift+Tab", "home-button");
|
||||
await expectFocusAfterKey("Shift+Tab", "tabbrowser-tabs", true);
|
||||
await expectFocusAfterKey("Tab", "home-button");
|
||||
await expectFocusAfterKey("Tab", gURLBar.inputField);
|
||||
await expectFocusAfterKey("Tab", afterUrlBarButton);
|
||||
await expectFocusAfterKey("Tab", "library-button");
|
||||
await expectFocusAfterKey("Tab", gBrowser.selectedBrowser);
|
||||
});
|
||||
maybeRemoveHomeButton();
|
||||
});
|
||||
|
||||
// Test tab stops with a page loaded.
|
||||
|
@ -155,7 +99,7 @@ add_task(async function testTabStopsPageLoaded() {
|
|||
await expectFocusAfterKey("Tab", "tracking-protection-icon-container");
|
||||
await expectFocusAfterKey("Tab", gURLBar.inputField);
|
||||
await expectFocusAfterKey("Tab", "pageActionButton");
|
||||
await expectFocusAfterKey("Tab", afterUrlBarButton);
|
||||
await expectFocusAfterKey("Tab", "library-button");
|
||||
await expectFocusAfterKey("Tab", gBrowser.selectedBrowser);
|
||||
});
|
||||
});
|
||||
|
@ -186,14 +130,14 @@ add_task(async function testTabStopsWithBookmarksToolbar() {
|
|||
await BrowserTestUtils.withNewTab("about:blank", async function() {
|
||||
CustomizableUI.setToolbarVisibility("PersonalToolbar", true);
|
||||
startFromUrlBar();
|
||||
await expectFocusAfterKey("Tab", afterUrlBarButton);
|
||||
await expectFocusAfterKey("Tab", "library-button");
|
||||
await expectFocusAfterKey("Tab", "PersonalToolbar", true);
|
||||
await expectFocusAfterKey("Tab", gBrowser.selectedBrowser);
|
||||
|
||||
// Make sure the Bookmarks toolbar is no longer tabbable once hidden.
|
||||
CustomizableUI.setToolbarVisibility("PersonalToolbar", false);
|
||||
startFromUrlBar();
|
||||
await expectFocusAfterKey("Tab", afterUrlBarButton);
|
||||
await expectFocusAfterKey("Tab", "library-button");
|
||||
await expectFocusAfterKey("Tab", gBrowser.selectedBrowser);
|
||||
});
|
||||
});
|
||||
|
@ -208,10 +152,8 @@ add_task(async function testTabStopNoButtons() {
|
|||
await expectFocusAfterKey("Shift+Tab", "tabbrowser-tabs", true);
|
||||
await expectFocusAfterKey("Tab", gURLBar.inputField);
|
||||
resetToolbarWithoutDevEditionButtons();
|
||||
maybeAddHomeBesideReload();
|
||||
// Make sure the button is reachable now that it has been re-added.
|
||||
await expectFocusAfterKey("Shift+Tab", "home-button", true);
|
||||
maybeRemoveHomeButton();
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -221,7 +163,6 @@ add_task(async function testTabStopNoButtons() {
|
|||
// 2. The overflow menu button can't be reached by right arrow when it isn't
|
||||
// visible.
|
||||
add_task(async function testArrowsToolbarbuttons() {
|
||||
maybeAddOldMenuSideButtons();
|
||||
await BrowserTestUtils.withNewTab("about:blank", async function() {
|
||||
startFromUrlBar();
|
||||
await expectFocusAfterKey("Tab", "library-button");
|
||||
|
@ -246,7 +187,6 @@ add_task(async function testArrowsToolbarbuttons() {
|
|||
await expectFocusAfterKey("ArrowLeft", "sidebar-button");
|
||||
await expectFocusAfterKey("ArrowLeft", "library-button");
|
||||
});
|
||||
maybeRemoveOldMenuSideButtons();
|
||||
});
|
||||
|
||||
// Test that right/left arrows move through buttons wihch aren't toolbarbuttons
|
||||
|
@ -298,7 +238,6 @@ add_task(async function testArrowsDisabledButtons() {
|
|||
|
||||
// Test that right arrow reaches the overflow menu button when it is visible.
|
||||
add_task(async function testArrowsOverflowButton() {
|
||||
maybeAddOldMenuSideButtons();
|
||||
await BrowserTestUtils.withNewTab("about:blank", async function() {
|
||||
// Move something to the overflow menu to make the button appear.
|
||||
CustomizableUI.addWidgetToArea(
|
||||
|
@ -317,7 +256,6 @@ add_task(async function testArrowsOverflowButton() {
|
|||
document.getElementById("nav-bar-overflow-button").clientWidth;
|
||||
await expectFocusAfterKey("ArrowLeft", "fxa-toolbar-menu-button");
|
||||
});
|
||||
maybeRemoveOldMenuSideButtons();
|
||||
});
|
||||
|
||||
// Test that toolbar keyboard navigation doesn't interfere with PanelMultiView
|
||||
|
@ -325,7 +263,6 @@ add_task(async function testArrowsOverflowButton() {
|
|||
// We do this by opening the Library menu and ensuring that pressing left arrow
|
||||
// does nothing.
|
||||
add_task(async function testArrowsInPanelMultiView() {
|
||||
maybeAddOldMenuSideButtons();
|
||||
let button = document.getElementById("library-button");
|
||||
forceFocus(button);
|
||||
EventUtils.synthesizeKey(" ");
|
||||
|
@ -342,12 +279,10 @@ add_task(async function testArrowsInPanelMultiView() {
|
|||
let hidden = BrowserTestUtils.waitForEvent(document, "popuphidden", true);
|
||||
view.closest("panel").hidePopup();
|
||||
await hidden;
|
||||
maybeRemoveOldMenuSideButtons();
|
||||
});
|
||||
|
||||
// Test that right/left arrows move in the expected direction for RTL locales.
|
||||
add_task(async function testArrowsRtl() {
|
||||
maybeAddOldMenuSideButtons();
|
||||
await SpecialPowers.pushPrefEnv({ set: [["intl.l10n.pseudo", "bidi"]] });
|
||||
// window.RTL_UI doesn't update in existing windows when this pref is changed,
|
||||
// so we need to test in a new window.
|
||||
|
@ -363,7 +298,6 @@ add_task(async function testArrowsRtl() {
|
|||
await expectFocusAfterKey("ArrowLeft", "sidebar-button", false, win);
|
||||
await BrowserTestUtils.closeWindow(win);
|
||||
await SpecialPowers.popPrefEnv();
|
||||
maybeRemoveOldMenuSideButtons();
|
||||
});
|
||||
|
||||
// Test that right arrow reaches the overflow menu button on the Bookmarks
|
||||
|
@ -396,7 +330,6 @@ registerCleanupFunction(async function() {
|
|||
// Test that when a toolbar button opens a panel, closing the panel restores
|
||||
// focus to the button which opened it.
|
||||
add_task(async function testPanelCloseRestoresFocus() {
|
||||
maybeAddOldMenuSideButtons();
|
||||
await withNewBlankTab(async function() {
|
||||
// We can't use forceFocus because that removes focusability immediately.
|
||||
// Instead, we must let ToolbarKeyboardNavigator handle this properly.
|
||||
|
@ -415,7 +348,6 @@ add_task(async function testPanelCloseRestoresFocus() {
|
|||
"Focus restored to Library button after panel closed"
|
||||
);
|
||||
});
|
||||
maybeRemoveOldMenuSideButtons();
|
||||
});
|
||||
|
||||
// Test that the arrow key works in the group of the
|
||||
|
@ -445,8 +377,6 @@ add_task(async function testArrowKeyForTPIconContainerandIdentityBox() {
|
|||
|
||||
// Test navigation by typed characters.
|
||||
add_task(async function testCharacterNavigation() {
|
||||
maybeAddHomeBesideReload();
|
||||
maybeAddOldMenuSideButtons();
|
||||
await BrowserTestUtils.withNewTab("https://example.com", async function() {
|
||||
await waitUntilReloadEnabled();
|
||||
startFromUrlBar();
|
||||
|
@ -471,8 +401,6 @@ add_task(async function testCharacterNavigation() {
|
|||
// Pressing s again should find the next button starting with s: Sidebars.
|
||||
await expectFocusAfterKey("s", "sidebar-button");
|
||||
});
|
||||
maybeRemoveHomeButton();
|
||||
maybeRemoveOldMenuSideButtons();
|
||||
});
|
||||
|
||||
// Test that toolbar character navigation doesn't trigger in PanelMultiView for
|
||||
|
@ -482,7 +410,6 @@ add_task(async function testCharacterNavigation() {
|
|||
// This test should be removed if PanelMultiView implements character
|
||||
// navigation.
|
||||
add_task(async function testCharacterInPanelMultiView() {
|
||||
maybeAddOldMenuSideButtons();
|
||||
let button = document.getElementById("library-button");
|
||||
forceFocus(button);
|
||||
let view = document.getElementById("appMenu-libraryView");
|
||||
|
@ -495,12 +422,10 @@ add_task(async function testCharacterInPanelMultiView() {
|
|||
let hidden = BrowserTestUtils.waitForEvent(document, "popuphidden", true);
|
||||
view.closest("panel").hidePopup();
|
||||
await hidden;
|
||||
maybeRemoveOldMenuSideButtons();
|
||||
});
|
||||
|
||||
// Test tab stops after the search bar is added.
|
||||
add_task(async function testTabStopsAfterSearchBarAdded() {
|
||||
maybeAddOldMenuSideButtons();
|
||||
await SpecialPowers.pushPrefEnv({
|
||||
set: [["browser.search.widget.inNavBar", 1]],
|
||||
});
|
||||
|
@ -510,5 +435,4 @@ add_task(async function testTabStopsAfterSearchBarAdded() {
|
|||
await expectFocusAfterKey("Tab", "library-button");
|
||||
});
|
||||
await SpecialPowers.popPrefEnv();
|
||||
maybeRemoveOldMenuSideButtons();
|
||||
});
|
||||
|
|
|
@ -12,15 +12,6 @@ function failIfSidebarFocusedFires() {
|
|||
ok(false, "This event shouldn't have fired");
|
||||
}
|
||||
|
||||
add_task(function setup() {
|
||||
if (CustomizableUI.protonToolbarEnabled) {
|
||||
CustomizableUI.addWidgetToArea("sidebar-button", "nav-bar");
|
||||
registerCleanupFunction(() =>
|
||||
CustomizableUI.removeWidgetFromArea("sidebar-button")
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
add_task(async function testAdoptedTwoWindows() {
|
||||
// First open a new window, show the sidebar in that window, and close it.
|
||||
// Then, open another new window and confirm that the sidebar is closed since it is
|
||||
|
|
|
@ -16,17 +16,6 @@ registerCleanupFunction(async function resetToolbar() {
|
|||
await CustomizableUI.reset();
|
||||
});
|
||||
|
||||
add_task(async function setupHomeButton() {
|
||||
if (CustomizableUI.protonToolbarEnabled) {
|
||||
// Put the home button in the pre-proton placement to test focus states.
|
||||
CustomizableUI.addWidgetToArea(
|
||||
"home-button",
|
||||
"nav-bar",
|
||||
CustomizableUI.getPlacementOfWidget("stop-reload-button").position + 1
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
function synthesizeKeyAndWaitForFocus(element, keyCode, options) {
|
||||
let focused = BrowserTestUtils.waitForEvent(element, "focus");
|
||||
EventUtils.synthesizeKey(keyCode, options);
|
||||
|
|
|
@ -39,7 +39,11 @@ add_task(async function test_ui_state_notification_calls_updateAllUI() {
|
|||
|
||||
add_task(async function test_navBar_button_visibility() {
|
||||
const button = document.getElementById("fxa-toolbar-menu-button");
|
||||
info("proton enabled: " + CustomizableUI.protonToolbarEnabled);
|
||||
const protonEnabled = Services.prefs.getBoolPref(
|
||||
"browser.proton.toolbar.enabled",
|
||||
false
|
||||
);
|
||||
info("pref browser.proton.toolbar.enabled: " + protonEnabled);
|
||||
|
||||
ok(button.closest("#nav-bar"), "button is in the #nav-bar");
|
||||
|
||||
|
@ -50,7 +54,7 @@ add_task(async function test_navBar_button_visibility() {
|
|||
gSync.updateAllUI(state);
|
||||
is(
|
||||
BrowserTestUtils.is_visible(button),
|
||||
!CustomizableUI.protonToolbarEnabled,
|
||||
!protonEnabled,
|
||||
"Check button visibility with STATUS_NOT_CONFIGURED"
|
||||
);
|
||||
|
||||
|
|
|
@ -8,13 +8,6 @@ add_task(async function() {
|
|||
await BrowserTestUtils.withNewTab(TEST_HTTP, async function(browser) {
|
||||
info("Tab ready");
|
||||
|
||||
if (CustomizableUI.protonToolbarEnabled) {
|
||||
CustomizableUI.addWidgetToArea("home-button", "nav-bar");
|
||||
registerCleanupFunction(() =>
|
||||
CustomizableUI.removeWidgetFromArea("home-button")
|
||||
);
|
||||
}
|
||||
|
||||
document.getElementById("home-button").click();
|
||||
await BrowserTestUtils.browserLoaded(browser, false, HomePage.get());
|
||||
is(gURLBar.value, "", "URL bar should be empty");
|
||||
|
|
|
@ -469,7 +469,7 @@ add_task(async function checkContextMenu() {
|
|||
);
|
||||
|
||||
info("Check context menu in another button");
|
||||
await openContextMenu(document.getElementById("reload-button"));
|
||||
await openContextMenu(document.getElementById("home-button"));
|
||||
is(checkbox.hidden, true, "Auto-hide checkbox is hidden");
|
||||
contextMenu.hidePopup();
|
||||
|
||||
|
|
|
@ -75,12 +75,6 @@ function assertTelemetryMatches(events) {
|
|||
add_task(async function test_setup() {
|
||||
// Clear any previosuly collected telemetry event.
|
||||
Services.telemetry.clearEvents();
|
||||
if (CustomizableUI.protonToolbarEnabled) {
|
||||
CustomizableUI.addWidgetToArea("home-button", "nav-bar");
|
||||
registerCleanupFunction(() =>
|
||||
CustomizableUI.removeWidgetFromArea("home-button")
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
add_task(async function browseraction_popup_contextmenu() {
|
||||
|
|
|
@ -10,9 +10,6 @@
|
|||
// Cleanup.
|
||||
registerCleanupFunction(async () => {
|
||||
CustomizableUI.setToolbarVisibility("PersonalToolbar", false);
|
||||
if (CustomizableUI.protonToolbarEnabled) {
|
||||
CustomizableUI.removeWidgetFromArea("library-button");
|
||||
}
|
||||
SidebarUI.hide();
|
||||
});
|
||||
|
||||
|
@ -21,7 +18,7 @@ async function selectAppMenuView(buttonId, viewId) {
|
|||
await BrowserTestUtils.waitForCondition(() => {
|
||||
btn = document.getElementById(buttonId);
|
||||
return btn;
|
||||
}, "Should have the " + buttonId + " button");
|
||||
}, "Should have the " + buttonId + "button");
|
||||
btn.click();
|
||||
let view = document.getElementById(viewId);
|
||||
let viewPromise = BrowserTestUtils.waitForEvent(view, "ViewShown");
|
||||
|
@ -37,10 +34,6 @@ async function openBookmarkingPanelInLibraryToolbarButton() {
|
|||
}
|
||||
|
||||
add_task(async function test_enable_toolbar() {
|
||||
if (CustomizableUI.protonToolbarEnabled) {
|
||||
CustomizableUI.addWidgetToArea("library-button", "nav-bar");
|
||||
}
|
||||
|
||||
await openBookmarkingPanelInLibraryToolbarButton();
|
||||
let toolbar = document.getElementById("PersonalToolbar");
|
||||
Assert.ok(toolbar.collapsed, "Bookmarks Toolbar is hidden");
|
||||
|
|
|
@ -593,9 +593,6 @@ add_task(async function dont_consume_clicks() {
|
|||
|
||||
// Dropping text to the searchbar should open the popup
|
||||
add_task(async function drop_opens_popup() {
|
||||
if (CustomizableUI.protonToolbarEnabled) {
|
||||
CustomizableUI.addWidgetToArea("home-button", "nav-bar");
|
||||
}
|
||||
// The previous task leaves focus in the URL bar. However, in that case drags
|
||||
// can be interpreted as being selection drags by the drag manager, which
|
||||
// breaks the drag synthesis from EventUtils.js below. To avoid this, focus
|
||||
|
@ -635,9 +632,6 @@ add_task(async function drop_opens_popup() {
|
|||
await promise;
|
||||
|
||||
textbox.value = "";
|
||||
if (CustomizableUI.protonToolbarEnabled) {
|
||||
CustomizableUI.removeWidgetFromArea("home-button");
|
||||
}
|
||||
});
|
||||
|
||||
// Moving the caret using the cursor keys should not close the popup.
|
||||
|
|
|
@ -196,7 +196,7 @@ var tests = [
|
|||
let highlight = document.getElementById("UITourHighlight");
|
||||
is_element_hidden(highlight, "Highlight should initially be hidden");
|
||||
|
||||
gContentAPI.showHighlight("backForward");
|
||||
gContentAPI.showHighlight("home");
|
||||
waitForElementToBeVisible(
|
||||
highlight,
|
||||
check_highlight_size,
|
||||
|
|
|
@ -17,7 +17,7 @@ function getExpectedTargets() {
|
|||
"backForward",
|
||||
"devtools",
|
||||
"help",
|
||||
...(CustomizableUI.protonToolbarEnabled ? [] : ["home"]),
|
||||
"home",
|
||||
"library",
|
||||
"logins",
|
||||
"pageAction-bookmark",
|
||||
|
|
|
@ -14,15 +14,6 @@ const { TabStateFlusher } = ChromeUtils.import(
|
|||
"resource:///modules/sessionstore/TabStateFlusher.jsm"
|
||||
);
|
||||
|
||||
add_task(function addHomeButton() {
|
||||
if (CustomizableUI.protonToolbarEnabled) {
|
||||
CustomizableUI.addWidgetToArea("home-button", "nav-bar");
|
||||
registerCleanupFunction(() =>
|
||||
CustomizableUI.removeWidgetFromArea("home-button")
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Test what happens if loading a URL that should clear the
|
||||
* location bar after a parent process URL.
|
||||
|
|
|
@ -22,13 +22,6 @@ add_task(async function test_setup() {
|
|||
}
|
||||
await Services.search.setDefault(originalEngine);
|
||||
});
|
||||
|
||||
if (CustomizableUI.protonToolbarEnabled) {
|
||||
CustomizableUI.addWidgetToArea("home-button", "nav-bar");
|
||||
registerCleanupFunction(() =>
|
||||
CustomizableUI.removeWidgetFromArea("home-button")
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
|
|
|
@ -14,15 +14,6 @@ add_task(async function init() {
|
|||
}
|
||||
|
||||
registerCleanupFunction(PlacesUtils.history.clear);
|
||||
|
||||
if (CustomizableUI.protonToolbarEnabled) {
|
||||
CustomizableUI.addWidgetToArea("home-button", "nav-bar", 0);
|
||||
CustomizableUI.addWidgetToArea("sidebar-button", "nav-bar");
|
||||
registerCleanupFunction(() => {
|
||||
CustomizableUI.removeWidgetFromArea("home-button");
|
||||
CustomizableUI.removeWidgetFromArea("sidebar-button");
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
add_task(async function tabWithSearchString() {
|
||||
|
@ -344,9 +335,7 @@ async function waitForFocusOnNextFocusableElement(reverse = false) {
|
|||
while (
|
||||
nextFocusableElement &&
|
||||
(!nextFocusableElement.classList.contains("toolbarbutton-1") ||
|
||||
nextFocusableElement.hasAttribute("hidden") ||
|
||||
nextFocusableElement.hasAttribute("disabled") ||
|
||||
BrowserTestUtils.is_hidden(nextFocusableElement))
|
||||
nextFocusableElement.hasAttribute("hidden"))
|
||||
) {
|
||||
nextFocusableElement = reverse
|
||||
? nextFocusableElement.previousElementSibling
|
||||
|
|
|
@ -578,7 +578,7 @@ const tests = [
|
|||
info("Drop something.");
|
||||
let promise = BrowserTestUtils.browserLoaded(win.gBrowser.selectedBrowser);
|
||||
EventUtils.synthesizeDrop(
|
||||
win.document.getElementById("back-button"),
|
||||
win.document.getElementById("home-button"),
|
||||
win.gURLBar.inputField,
|
||||
[[{ type: "text/plain", data: "www.example.com" }]],
|
||||
"copy",
|
||||
|
|
|
@ -20,19 +20,11 @@ add_task(async function test_usage_button_prefs_set() {
|
|||
await SpecialPowers.pushPrefEnv({
|
||||
set: [["browser.download.autohideButton", false]],
|
||||
});
|
||||
if (CustomizableUI.protonToolbarEnabled) {
|
||||
// Move the FxA button to the toolbar so it doesn't get auto-hidden.
|
||||
CustomizableUI.addWidgetToArea("fxa-toolbar-menu-button", "TabsToolbar");
|
||||
CustomizableUI.addWidgetToArea("home-button", "nav-bar");
|
||||
CustomizableUI.addWidgetToArea("sidebar-button", "nav-bar");
|
||||
CustomizableUI.addWidgetToArea("library-button", "nav-bar");
|
||||
}
|
||||
|
||||
registerCleanupFunction(async () => {
|
||||
registerCleanupFunction(() => {
|
||||
// Clicking on the sidebar button will show the sidebar, so we'll
|
||||
// make sure it's hidden when the test ends.
|
||||
SidebarUI.hide();
|
||||
await CustomizableUI.reset();
|
||||
});
|
||||
|
||||
const PREFS_TO_FALSE = Object.values(BUTTONS_TO_TEST).map(prefName => {
|
||||
|
@ -44,7 +36,7 @@ add_task(async function test_usage_button_prefs_set() {
|
|||
});
|
||||
|
||||
// We open a new tab to ensure the test passes verify on Windows
|
||||
await BrowserTestUtils.withNewTab("about:blank", async () => {
|
||||
await BrowserTestUtils.withNewTab("about:blank", () => {
|
||||
for (let buttonID in BUTTONS_TO_TEST) {
|
||||
let pref = BUTTONS_TO_TEST[buttonID];
|
||||
Assert.ok(
|
||||
|
@ -54,16 +46,7 @@ add_task(async function test_usage_button_prefs_set() {
|
|||
|
||||
info(`Clicking on ${buttonID}`);
|
||||
let element = document.getElementById(buttonID);
|
||||
if (buttonID != "home-button" && buttonID != "sidebar-button") {
|
||||
let popupShown = BrowserTestUtils.waitForPopupEvent(window, "shown");
|
||||
let popupHidden = BrowserTestUtils.waitForPopupEvent(window, "hidden");
|
||||
EventUtils.synthesizeMouse(element, 5, 5, {}, window);
|
||||
let shownEvent = await popupShown;
|
||||
shownEvent.target.hidePopup();
|
||||
await popupHidden;
|
||||
} else {
|
||||
EventUtils.synthesizeMouse(element, 5, 5, {}, window);
|
||||
}
|
||||
EventUtils.synthesizeMouseAtCenter(element, {}, window);
|
||||
|
||||
Assert.ok(
|
||||
Services.prefs.getBoolPref(pref),
|
||||
|
|
|
@ -50,23 +50,13 @@ add_task(async function test_support_separator_properties() {
|
|||
);
|
||||
|
||||
let panelUIButton = document.querySelector("#PanelUI-button");
|
||||
if (CustomizableUI.protonToolbarEnabled) {
|
||||
Assert.equal(
|
||||
window
|
||||
.getComputedStyle(panelUIButton)
|
||||
.getPropertyValue("border-image-source"),
|
||||
"none",
|
||||
"No vertical separator on app menu"
|
||||
);
|
||||
} else {
|
||||
Assert.ok(
|
||||
window
|
||||
.getComputedStyle(panelUIButton)
|
||||
.getPropertyValue("border-image-source")
|
||||
.includes(`rgb(${hexToRGB(SEPARATOR_VERTICAL_COLOR).join(", ")})`),
|
||||
"Vertical separator color properly set"
|
||||
);
|
||||
}
|
||||
Assert.ok(
|
||||
window
|
||||
.getComputedStyle(panelUIButton)
|
||||
.getPropertyValue("border-image-source")
|
||||
.includes(`rgb(${hexToRGB(SEPARATOR_VERTICAL_COLOR).join(", ")})`),
|
||||
"Vertical separator color properly set"
|
||||
);
|
||||
|
||||
let toolbox = document.querySelector("#navigator-toolbox");
|
||||
Assert.equal(
|
||||
|
|
|
@ -5,15 +5,6 @@
|
|||
// This test checks whether applied WebExtension themes that attempt to change
|
||||
// the button background color properties are applied correctly.
|
||||
|
||||
add_task(async function setup_home_button() {
|
||||
if (CustomizableUI.protonToolbarEnabled) {
|
||||
CustomizableUI.addWidgetToArea("home-button", "nav-bar");
|
||||
registerCleanupFunction(() =>
|
||||
CustomizableUI.removeWidgetFromArea("home-button")
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
add_task(async function test_button_background_properties() {
|
||||
const BUTTON_BACKGROUND_ACTIVE = "#FFFFFF";
|
||||
const BUTTON_BACKGROUND_HOVER = "#59CBE8";
|
||||
|
|
|
@ -3,15 +3,6 @@
|
|||
// This test checks applied WebExtension themes that attempt to change
|
||||
// icon color properties
|
||||
|
||||
add_task(async function setup_home_button() {
|
||||
if (CustomizableUI.protonToolbarEnabled) {
|
||||
CustomizableUI.addWidgetToArea("home-button", "nav-bar");
|
||||
registerCleanupFunction(() =>
|
||||
CustomizableUI.removeWidgetFromArea("home-button")
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
add_task(async function test_icons_properties() {
|
||||
const ICONS_COLOR = "#001b47";
|
||||
const ICONS_ATTENTION_COLOR = "#44ba77";
|
||||
|
|
Загрузка…
Ссылка в новой задаче