commit ff19d0ada860d23267235364b416868cdd6e7b36 parent ac87939bf7bcf5b5101dc8af52a5950957b174bf Author: Dão Gottwald <dao@mozilla.com> Date: Wed, 17 Dec 2025 15:10:40 +0000 Bug 2006632 - Enable the new search bar implementation in Nightly. r=mbeier Differential Revision: https://phabricator.services.mozilla.com/D276841 Diffstat:
12 files changed, 45 insertions(+), 3 deletions(-)
diff --git a/browser/app/profile/firefox.js b/browser/app/profile/firefox.js @@ -887,7 +887,11 @@ pref("browser.search.serpMetricsRecordedCounter", 0); // days pref("browser.search.widget.removeAfterDaysUnused", 120); +#ifdef NIGHTLY_BUILD +pref("browser.search.widget.new", true); +#else pref("browser.search.widget.new", false); +#endif // The number of times the search function in the URL bar has been used, // capped at 100. diff --git a/browser/base/content/test/keyboard/browser_toolbarKeyNav.js b/browser/base/content/test/keyboard/browser_toolbarKeyNav.js @@ -131,6 +131,7 @@ add_setup(async function () { // onorous and creates issues with existing tests without improving test // coverage, so disable it herein. ["browser.taskbarTabs.enabled", false], + ["browser.search.widget.new", false], ], }); resetToolbarWithoutDevEditionButtons(); diff --git a/browser/components/customizableui/test/browser_901207_searchbar_in_panel.js b/browser/components/customizableui/test/browser_901207_searchbar_in_panel.js @@ -18,6 +18,12 @@ async function waitForSearchBarFocus() { }); } +add_setup(async function () { + await SpecialPowers.pushPrefEnv({ + set: [["browser.search.widget.new", false]], + }); +}); + // Ctrl+K should open the menu panel and focus the search bar if the search bar is in the panel. add_task(async function check_shortcut_when_in_closed_overflow_panel_closed() { CustomizableUI.addWidgetToArea( diff --git a/browser/components/customizableui/test/browser_913972_currentset_overflow.js b/browser/components/customizableui/test/browser_913972_currentset_overflow.js @@ -10,6 +10,12 @@ registerCleanupFunction(async function asyncCleanup() { await resetCustomization(); }); +add_setup(async function () { + await SpecialPowers.pushPrefEnv({ + set: [["browser.search.widget.new", false]], + }); +}); + // Default state no longer overflows at minimum window width (bug 1960002). // Add buttons to trigger overflow, resize to a small window, resize back, // shouldn't change state. diff --git a/browser/components/customizableui/test/browser_940307_panel_click_closure_handling.js b/browser/components/customizableui/test/browser_940307_panel_click_closure_handling.js @@ -27,6 +27,10 @@ add_task(async function plain_button() { }); add_task(async function searchbar_in_panel() { + SpecialPowers.pushPrefEnv({ + set: [["browser.search.widget.new", false]], + }); + CustomizableUI.addWidgetToArea( "search-container", CustomizableUI.AREA_FIXED_OVERFLOW_PANEL diff --git a/browser/components/enterprisepolicies/tests/browser/browser_policy_search_engine.js b/browser/components/enterprisepolicies/tests/browser/browser_policy_search_engine.js @@ -10,6 +10,9 @@ ChromeUtils.defineESModuleGetters(this, { let gCUITestUtils = new CustomizableUITestUtils(window); add_task(async function test_setup() { + SpecialPowers.pushPrefEnv({ + set: [["browser.search.widget.new", false]], + }); await gCUITestUtils.addSearchBar(); registerCleanupFunction(() => { gCUITestUtils.removeSearchBar(); diff --git a/browser/components/extensions/test/browser/browser_unified_extensions_overflowable_toolbar.js b/browser/components/extensions/test/browser/browser_unified_extensions_overflowable_toolbar.js @@ -31,6 +31,10 @@ const OVERFLOWED_DEFAULT_WIDGET_IDS = DEFAULT_WIDGET_IDS.slice( const OVERFLOWED_EXTENSIONS_LIST_ID = "overflowed-extensions-list"; add_setup(async function () { + await SpecialPowers.pushPrefEnv({ + set: [["browser.search.widget.new", false]], + }); + // To make it easier to control things that will overflow, we'll start by // removing that's removable out of the nav-bar and adding just a fixed // set of items (DEFAULT_WIDGET_IDS) at the end of the nav-bar. diff --git a/browser/components/search/test/browser/browser.toml b/browser/components/search/test/browser/browser.toml @@ -15,6 +15,7 @@ support-files = [ "tooManyEnginesOffered.html", ] tags = "searchnontelem" +prefs = ["browser.search.widget.new=false"] ["browser_426329.js"] support-files = ["test.html", "discovery.html", "426329.xml"] diff --git a/browser/components/search/test/browser/telemetry/browser.toml b/browser/components/search/test/browser/telemetry/browser.toml @@ -1,7 +1,7 @@ [DEFAULT] tags = "search-telemetry" support-files = ["head.js", "head-spa.js"] -prefs = ["browser.search.log=true"] +prefs = ["browser.search.log=true", "browser.search.widget.new=false"] ["browser_search_glean_serp_event_telemetry_categorization_enabled_by_pref.js"] support-files = ["searchTelemetryDomainCategorizationReporting.html"] diff --git a/editor/libeditor/tests/browser_content_command_insert_text.js b/editor/libeditor/tests/browser_content_command_insert_text.js @@ -13,7 +13,10 @@ const gCUITestUtils = new CustomizableUITestUtils(window); const gDOMWindowUtils = EventUtils._getDOMWindowUtils(window); let searchBar; -add_task(async function test_setup() { +add_setup(async function () { + await SpecialPowers.pushPrefEnv({ + set: [["browser.search.widget.new", false]], + }); searchBar = await gCUITestUtils.addSearchBar(); registerCleanupFunction(() => { gCUITestUtils.removeSearchBar(); diff --git a/layout/xul/test/browser_bug1163304.js b/layout/xul/test/browser_bug1163304.js @@ -5,6 +5,9 @@ let gCUITestUtils = new CustomizableUITestUtils(window); let searchBar; add_task(async function test_setup() { + await SpecialPowers.pushPrefEnv({ + set: [["browser.search.widget.new", false]], + }); searchBar = await gCUITestUtils.addSearchBar(); registerCleanupFunction(() => { gCUITestUtils.removeSearchBar(); diff --git a/toolkit/components/extensions/test/browser/browser_ext_themes_toolbar_fields.js b/toolkit/components/extensions/test/browser/browser_ext_themes_toolbar_fields.js @@ -9,6 +9,9 @@ const { CustomizableUITestUtils } = ChromeUtils.importESModule( let gCUITestUtils = new CustomizableUITestUtils(window); add_setup(async function () { + await SpecialPowers.pushPrefEnv({ + set: [["browser.search.widget.new", false]], + }); await gCUITestUtils.addSearchBar(); registerCleanupFunction(() => { gCUITestUtils.removeSearchBar(); @@ -50,7 +53,11 @@ add_task(async function test_support_toolbar_field_properties() { let fields = [ document.querySelector("#urlbar > .urlbar-background"), - document.getElementById("searchbar"), + document.querySelector( + Services.prefs.getBoolPref("browser.search.widget.new") + ? "#searchbar-new > .urlbar-background" + : "#searchbar" + ), ].filter(field => { let bounds = field.getBoundingClientRect(); return bounds.width > 0 && bounds.height > 0;