tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 9f0609ef05e468a28e60f0f58c94057d6f3a6af0
parent 9c23c57825ddf9173dd0dd4aae4cf69e6c506fc2
Author: Serban Stanca <sstanca@mozilla.com>
Date:   Wed,  8 Oct 2025 13:29:01 +0300

Revert "Bug 1912020 - Update browser_ext_themes_sidebar test to support new sidebar r=extension-reviewers,nsharpley,kcochrane,robwu" for causing mochitests failures in browser_ext_themes_sidebars.js.

This reverts commit 9c23c57825ddf9173dd0dd4aae4cf69e6c506fc2.

Diffstat:
Mbrowser/themes/shared/sidebar.css | 11+++++++----
Mtoolkit/components/extensions/test/browser/browser_ext_themes_sidebars.js | 101+++----------------------------------------------------------------------------
2 files changed, 10 insertions(+), 102 deletions(-)

diff --git a/browser/themes/shared/sidebar.css b/browser/themes/shared/sidebar.css @@ -368,10 +368,13 @@ sidebar-main, pref is set to "expand-on-hover" as opposed to when the "sidebar-expand-on-hover" attribute has been added to root. There are certain scenarios when that attribute is temporarily removed from root such as when toggling the sidebar to expand with the toolbar button. */ - #sidebar { - box-shadow: none; - margin-block-start: 1px; - outline-offset: -0.1px; + #sidebar-box { + --sidebar-border-color: light-dark(rgb(207, 207, 216), rgb(82, 82, 94)); + > #sidebar { + box-shadow: none; + margin-block-start: 1px; + border: 0.5px solid var(--sidebar-border-color); + } } } diff --git a/toolkit/components/extensions/test/browser/browser_ext_themes_sidebars.js b/toolkit/components/extensions/test/browser/browser_ext_themes_sidebars.js @@ -7,9 +7,6 @@ registerCleanupFunction(async function () { if (!document.getElementById("sidebar-box").hidden) { SidebarController.hide({ dismissPanel: true }); } - Services.prefs.clearUserPref( - "browser.toolbarbuttons.introduced.sidebar-button" - ); }); /** @@ -25,7 +22,6 @@ async function test_sidebar_theme(theme, isBrightText) { }, }); - const sidebarBrowser = document.getElementById("sidebar"); const sidebarBox = document.getElementById("sidebar-box"); const browserRoot = document.documentElement; const content = SidebarController.browser.contentWindow; @@ -126,9 +122,7 @@ async function test_sidebar_theme(theme, isBrightText) { ); if (isCustomSidebar) { - const sidebarBoxCS = window.getComputedStyle( - Services.prefs.getBoolPref("sidebar.revamp") ? sidebarBrowser : sidebarBox - ); + const sidebarBoxCS = window.getComputedStyle(sidebarBox); is( sidebarBoxCS.backgroundColor, actualBackground, @@ -192,7 +186,7 @@ async function test_sidebar_theme(theme, isBrightText) { ); } -async function check_themes() { +add_task(async function test_support_sidebar_colors() { for (let command of ["viewBookmarksSidebar", "viewHistorySidebar"]) { info("Executing command: " + command); @@ -240,19 +234,9 @@ async function check_themes() { false ); } -} -add_task(async function test_old_sidebar_colors() { - await SpecialPowers.pushPrefEnv({ - set: [["sidebar.revamp", false]], - }); - await check_themes(); - await SpecialPowers.popPrefEnv(); }); -add_task(async function test_old_sidebar_border_color() { - await SpecialPowers.pushPrefEnv({ - set: [["sidebar.revamp", false]], - }); +add_task(async function test_support_sidebar_border_color() { const LIGHT_SALMON = "#ffa07a"; const extension = ExtensionTestUtils.loadExtension({ manifest: { @@ -297,83 +281,4 @@ add_task(async function test_old_sidebar_border_color() { } await extension.unload(); - await SpecialPowers.popPrefEnv(); -}); - -add_task(async function test_support_sidebar_colors() { - await SpecialPowers.pushPrefEnv({ - set: [["sidebar.revamp", true]], - }); - await check_themes(); - await SpecialPowers.popPrefEnv(); -}); - -add_task(async function test_support_sidebar_border_color() { - await SpecialPowers.pushPrefEnv({ - set: [["sidebar.revamp", true]], - }); - const command = "viewHistorySidebar"; - info("Executing command: " + command); - - await SidebarController.show(command); - - const LIGHT_SALMON = "#ffa07a"; - const extension = ExtensionTestUtils.loadExtension({ - manifest: { - theme: { - colors: { - sidebar_border: LIGHT_SALMON, - }, - }, - }, - }); - - await extension.startup(); - - const sidebarPanel = document.getElementById("sidebar"); - const sidebarPanelCS = window.getComputedStyle(sidebarPanel); - - is( - sidebarPanelCS.outlineColor, - hexToCSS(LIGHT_SALMON), - "The card border of the history sidebar panel should be colored properly" - ); - - await SpecialPowers.pushPrefEnv({ - set: [ - ["sidebar.verticalTabs", true], - ["sidebar.visibility", "expand-on-hover"], - ], - }); - - // We only apply the border color to the launcher for expand on hover since it can overlap an open - // sidebar panel making it difficult to distinguish where one surface ends and the other begins. - is( - sidebarPanelCS.outlineColor, - hexToCSS(LIGHT_SALMON), - "The card border of the history sidebar panel should still be colored properly" - ); - - const sidebarLauncher = document.getElementById("sidebar-main"); - const sidebarLauncherCS = window.getComputedStyle(sidebarLauncher); - - is( - sidebarLauncherCS.borderInlineEndColor, - hexToCSS(LIGHT_SALMON), - "Sidebar launcher should be colored properly" - ); - - SidebarController.reversePosition(); - - is( - sidebarLauncherCS.borderInlineStartColor, - hexToCSS(LIGHT_SALMON), - "Sidebar launcher should be colored properly after switching sides" - ); - - SidebarController.reversePosition(); - - await extension.unload(); - await SpecialPowers.popPrefEnv(); - await SpecialPowers.popPrefEnv(); });