commit abd461589618359a9f1e4e4ed605d90bbebff9dc
parent c967f45b97851fcba260b554798dc0e125a75ffa
Author: Sam Foster <sfoster@mozilla.com>
Date: Tue, 2 Dec 2025 17:44:04 +0000
Bug 2002398 - Expect focus to land on the sidebar-button when revamp is enabled & shift+tabbing to the tabstrip. r=tabbrowser-reviewers,sthompson
Differential Revision: https://phabricator.services.mozilla.com/D274175
Diffstat:
1 file changed, 19 insertions(+), 5 deletions(-)
diff --git a/browser/components/tabbrowser/test/browser/tabs/browser_multiselect_tabs_using_keyboard.js b/browser/components/tabbrowser/test/browser/tabs/browser_multiselect_tabs_using_keyboard.js
@@ -57,11 +57,25 @@ add_task(async function changeSelectionUsingKeyboard() {
unifiedSearchButton,
"Unified Search Button should be focused"
);
- await synthesizeKeyAndWaitForFocus(
- document.getElementById("reload-button"),
- "VK_TAB",
- { shiftKey: true }
- );
+ if (Services.prefs.getBoolPref("sidebar.revamp", false)) {
+ // when sidebar.revamp is enabled, the sidebar-button is placed by default at the
+ // start of the #nav-bar and will receive focus.
+ info("Move focus to the sidebar-button using the keyboard");
+ await synthesizeKeyAndWaitForFocus(
+ document.getElementById("sidebar-button"),
+ "VK_TAB",
+ { shiftKey: true }
+ );
+ } else {
+ info("Move focus to the reload-button using the keyboard");
+ await synthesizeKeyAndWaitForFocus(
+ document.getElementById("reload-button"),
+ "VK_TAB",
+ { shiftKey: true }
+ );
+ }
+
+ info("Move focus to the tabs-newtab-button using the keyboard");
await synthesizeKeyAndWaitForFocus(
document.getElementById("tabs-newtab-button"),
"VK_TAB",