commit febe4d9096a9d2ec9ffa2c20bb0b1da8e1ab3ba2 parent 61440368f6511ef0a3736de2841a9a841b28c9fb Author: Drew Willcoxon <adw@mozilla.com> Date: Mon, 27 Oct 2025 22:28:20 +0000 Bug 1995574 - Part 1: Core Suggest code: Replace the `browser.urlbar.suggest.quicksuggest.nonsponsored` pref with `browser.urlbar.suggest.quicksuggest.all`. r=daisuke,Standard8,urlbar-reviewers This is part 1 of 5 and integrates the new `all` pref with core Suggest code plus AMP and Wikipedia suggestions. To recap, we're removing the `nonsponsored` pref and adding a new pref that controls all Suggest suggestions, which this patch calls `all`. In order for nonsponsored suggestions to be shown, `all` must be true. For sponsored suggestions to be shown, both `all` and `suggest.quicksuggest.sponsored` must be true. Depends on D269720 Differential Revision: https://phabricator.services.mozilla.com/D269893 Diffstat:
23 files changed, 208 insertions(+), 219 deletions(-)
diff --git a/browser/app/profile/firefox.js b/browser/app/profile/firefox.js @@ -467,6 +467,13 @@ pref("browser.urlbar.suggest.weather", true); // trending suggestions are turned on. pref("browser.urlbar.suggest.trending", true); +// Whether results that are part of the Firefox Suggest brand are shown in the +// urlbar. This pref is exposed to the user in the UI, and it's sticky so that +// its user-branch value persists regardless of whatever Firefox Suggest +// scenarios, with their various default-branch values, the user is enrolled in +// over time. +pref("browser.urlbar.suggest.quicksuggest.all", false, sticky); + // Whether non-sponsored quick suggest results are shown in the urlbar. This // pref is exposed to the user in the UI, and it's sticky so that its // user-branch value persists regardless of whatever Firefox Suggest scenarios, diff --git a/browser/components/urlbar/QuickSuggest.sys.mjs b/browser/components/urlbar/QuickSuggest.sys.mjs @@ -81,8 +81,7 @@ const SUGGEST_PREFS = Object.freeze({ US: [EN_LOCALES, SETTINGS_UI.OFFLINE_ONLY], }, }, - "suggest.quicksuggest.nonsponsored": { - nimbusVariableIfExposedInUi: "quickSuggestNonSponsoredEnabled", + "suggest.quicksuggest.all": { defaultValues: { DE: [["de"], true], FR: [["fr"], true], diff --git a/browser/components/urlbar/UrlbarPrefs.sys.mjs b/browser/components/urlbar/UrlbarPrefs.sys.mjs @@ -496,10 +496,11 @@ const PREF_URLBAR_DEFAULTS = /** @type {PreferenceDefinition[]} */ ([ // Whether results will include QuickActions in the default search mode. ["suggest.quickactions", false], - // Whether results will include non-sponsored quick suggest suggestions. - ["suggest.quicksuggest.nonsponsored", false], + // Whether results will include Suggest suggestions. + ["suggest.quicksuggest.all", false], - // Whether results will include sponsored quick suggest suggestions. + // Whether results will include sponsored Suggest suggestions. Only relevant + // if the `all` pref is true. ["suggest.quicksuggest.sponsored", false], // Whether results will include Realtime suggestion opt-in result. diff --git a/browser/components/urlbar/UrlbarProviderQuickSuggest.sys.mjs b/browser/components/urlbar/UrlbarProviderQuickSuggest.sys.mjs @@ -569,10 +569,9 @@ export class UrlbarProviderQuickSuggest extends UrlbarProvider { let feature = lazy.QuickSuggest.getFeatureByResult(result); if ( !feature && - ((result.payload.isSponsored && - !lazy.UrlbarPrefs.get("suggest.quicksuggest.sponsored")) || - (!result.payload.isSponsored && - !lazy.UrlbarPrefs.get("suggest.quicksuggest.nonsponsored"))) + (!lazy.UrlbarPrefs.get("suggest.quicksuggest.all") || + (result.payload.isSponsored && + !lazy.UrlbarPrefs.get("suggest.quicksuggest.sponsored"))) ) { return false; } diff --git a/browser/components/urlbar/docs/preferences.rst b/browser/components/urlbar/docs/preferences.rst @@ -41,15 +41,16 @@ browser.urlbar.suggest.openpage (boolean, default: true) Whether results will include switch-to-tab results. Can be controlled from Privacy Preferences. -browser.urlbar.suggest.quicksuggest.nonsponsored (boolean, default: false) +browser.urlbar.suggest.quicksuggest.all (boolean, default: false) If ``browser.urlbar.quicksuggest.enabled`` is true, this controls whether - results will include non-sponsored quick suggest suggestions. Otherwise - non-sponsored suggestions will not be shown. + results will include suggestions that are part of the Firefox Suggest brand. + Otherwise they will not be included. browser.urlbar.suggest.quicksuggest.sponsored (boolean, default: false) - If ``browser.urlbar.quicksuggest.enabled`` is true, this controls whether - results will include sponsored quick suggest suggestions. Otherwise sponsored - suggestions will not be shown. + If ``browser.urlbar.quicksuggest.enabled`` and + ``browser.urlbar.suggest.quicksuggest.all`` are true, this controls whether + results will include sponsored Firefox Suggest suggestions. Otherwise they + will not be included. browser.urlbar.suggest.searches (boolean, default: true) Whether results will include search suggestions. @@ -168,7 +169,7 @@ browser.urlbar.quicksuggest.enabled (boolean, default: false) results related to the user's search string. This pref can be overridden by the ``quickSuggestEnabled`` Nimbus variable. If false, neither sponsored nor non-sponsored quick suggest results will be shown. If true, then we look at - the individual prefs ``browser.urlbar.suggest.quicksuggest.nonsponsored`` and + the individual prefs ``browser.urlbar.suggest.quicksuggest.all`` and ``browser.urlbar.suggest.quicksuggest.sponsored``. browser.urlbar.quicksuggest.online.available (boolean, default: false) diff --git a/browser/components/urlbar/private/AmpSuggestions.sys.mjs b/browser/components/urlbar/private/AmpSuggestions.sys.mjs @@ -30,7 +30,12 @@ const TIMESTAMP_REGEXP = /^\d{10}$/; */ export class AmpSuggestions extends SuggestProvider { get enablingPreferences() { - return ["ampFeatureGate", "suggest.amp", "suggest.quicksuggest.sponsored"]; + return [ + "ampFeatureGate", + "suggest.amp", + "suggest.quicksuggest.all", + "suggest.quicksuggest.sponsored", + ]; } get primaryUserControlledPreferences() { diff --git a/browser/components/urlbar/private/SuggestBackendMerino.sys.mjs b/browser/components/urlbar/private/SuggestBackendMerino.sys.mjs @@ -8,7 +8,6 @@ const lazy = {}; ChromeUtils.defineESModuleGetters(lazy, { MerinoClient: "moz-src:///browser/components/urlbar/MerinoClient.sys.mjs", - UrlbarPrefs: "moz-src:///browser/components/urlbar/UrlbarPrefs.sys.mjs", }); /** @@ -50,21 +49,7 @@ export class SuggestBackendMerino extends SuggestBackend { this.#client = new lazy.MerinoClient(this.name, { allowOhttp: true }); } - let providers; - if ( - !lazy.UrlbarPrefs.get("suggest.quicksuggest.nonsponsored") && - !lazy.UrlbarPrefs.get("suggest.quicksuggest.sponsored") && - !lazy.UrlbarPrefs.get("merinoProviders") - ) { - // Data collection is enabled but suggestions are not. Per product - // requirements, we still want to ping Merino so it can record the query, - // but pass an empty list of providers to tell it not to fetch any - // suggestions. - providers = []; - } - let suggestions = await this.#client.fetch({ - providers, query: searchString, }); diff --git a/browser/components/urlbar/private/SuggestFeature.sys.mjs b/browser/components/urlbar/private/SuggestFeature.sys.mjs @@ -55,8 +55,8 @@ export class SuggestFeature { * include the feature's `featureGate` pref. * * These prefs should control this feature specifically, so they should - * never include `suggest.quicksuggest.sponsored` or - * `suggest.quicksuggest.nonsponsored`. If the feature has no such prefs, + * never include `suggest.quicksuggest.all` or + * `suggest.quicksuggest.sponsored`. If the feature has no such prefs, * this getter should return an empty array. */ get primaryUserControlledPreferences() { diff --git a/browser/components/urlbar/private/WikipediaSuggestions.sys.mjs b/browser/components/urlbar/private/WikipediaSuggestions.sys.mjs @@ -21,7 +21,7 @@ export class WikipediaSuggestions extends SuggestProvider { return [ "wikipediaFeatureGate", "suggest.wikipedia", - "suggest.quicksuggest.nonsponsored", + "suggest.quicksuggest.all", ]; } diff --git a/browser/components/urlbar/tests/quicksuggest/QuickSuggestTestUtils.sys.mjs b/browser/components/urlbar/tests/quicksuggest/QuickSuggestTestUtils.sys.mjs @@ -1609,7 +1609,7 @@ class _QuickSuggestTestUtils { "Timed out waiting for TOPIC_SEARCH_SERVICE (not an error)" ); resolve(); - }, 2000); + }, 1000); }), ]) ); diff --git a/browser/components/urlbar/tests/quicksuggest/browser/browser_quicksuggest_configuration.js b/browser/components/urlbar/tests/quicksuggest/browser/browser_quicksuggest_configuration.js @@ -15,7 +15,7 @@ ChromeUtils.defineESModuleGetters(this, { // We use this pref in enterprise preference policy tests. We specifically use a // pref that's sticky and exposed in the UI to make sure it can be set properly. -const POLICY_PREF = "suggest.quicksuggest.nonsponsored"; +const POLICY_PREF = "suggest.quicksuggest.sponsored"; let gDefaultBranch = Services.prefs.getDefaultBranch("browser.urlbar."); let gUserBranch = Services.prefs.getBranch("browser.urlbar."); @@ -94,17 +94,14 @@ add_task(async function () { { initialPrefsToSet: { defaultBranch: { - "suggest.quicksuggest.nonsponsored": true, "suggest.quicksuggest.sponsored": true, }, }, valueOverrides: { - quickSuggestNonSponsoredEnabled: false, quickSuggestSponsoredEnabled: false, }, expectedPrefs: { defaultBranch: { - "suggest.quicksuggest.nonsponsored": false, "suggest.quicksuggest.sponsored": false, }, }, @@ -112,21 +109,17 @@ add_task(async function () { { initialPrefsToSet: { userBranch: { - "suggest.quicksuggest.nonsponsored": true, "suggest.quicksuggest.sponsored": true, }, }, valueOverrides: { - quickSuggestNonSponsoredEnabled: false, quickSuggestSponsoredEnabled: false, }, expectedPrefs: { defaultBranch: { - "suggest.quicksuggest.nonsponsored": false, "suggest.quicksuggest.sponsored": false, }, userBranch: { - "suggest.quicksuggest.nonsponsored": true, "suggest.quicksuggest.sponsored": true, }, }, @@ -146,25 +139,20 @@ add_task(async function () { await checkEnrollments({ initialPrefsToSet: { defaultBranch: { - "suggest.quicksuggest.nonsponsored": true, "suggest.quicksuggest.sponsored": true, }, userBranch: { - "suggest.quicksuggest.nonsponsored": false, "suggest.quicksuggest.sponsored": false, }, }, valueOverrides: { - quickSuggestNonSponsoredEnabled: true, quickSuggestSponsoredEnabled: true, }, expectedPrefs: { defaultBranch: { - "suggest.quicksuggest.nonsponsored": true, "suggest.quicksuggest.sponsored": true, }, userBranch: { - "suggest.quicksuggest.nonsponsored": false, "suggest.quicksuggest.sponsored": false, }, }, @@ -191,17 +179,14 @@ add_task(async function () { { initialPrefsToSet: { defaultBranch: { - "suggest.quicksuggest.nonsponsored": false, "suggest.quicksuggest.sponsored": false, }, }, valueOverrides: { - quickSuggestNonSponsoredEnabled: true, quickSuggestSponsoredEnabled: true, }, expectedPrefs: { defaultBranch: { - "suggest.quicksuggest.nonsponsored": true, "suggest.quicksuggest.sponsored": true, }, }, @@ -209,21 +194,17 @@ add_task(async function () { { initialPrefsToSet: { userBranch: { - "suggest.quicksuggest.nonsponsored": false, "suggest.quicksuggest.sponsored": false, }, }, valueOverrides: { - quickSuggestNonSponsoredEnabled: true, quickSuggestSponsoredEnabled: true, }, expectedPrefs: { defaultBranch: { - "suggest.quicksuggest.nonsponsored": true, "suggest.quicksuggest.sponsored": true, }, userBranch: { - "suggest.quicksuggest.nonsponsored": false, "suggest.quicksuggest.sponsored": false, }, }, @@ -243,25 +224,20 @@ add_task(async function () { await checkEnrollments({ initialPrefsToSet: { defaultBranch: { - "suggest.quicksuggest.nonsponsored": false, "suggest.quicksuggest.sponsored": false, }, userBranch: { - "suggest.quicksuggest.nonsponsored": true, "suggest.quicksuggest.sponsored": true, }, }, valueOverrides: { - quickSuggestNonSponsoredEnabled: false, quickSuggestSponsoredEnabled: false, }, expectedPrefs: { defaultBranch: { - "suggest.quicksuggest.nonsponsored": false, "suggest.quicksuggest.sponsored": false, }, userBranch: { - "suggest.quicksuggest.nonsponsored": true, "suggest.quicksuggest.sponsored": true, }, }, diff --git a/browser/components/urlbar/tests/quicksuggest/browser/browser_telemetry_environment.js b/browser/components/urlbar/tests/quicksuggest/browser/browser_telemetry_environment.js @@ -13,11 +13,6 @@ add_setup(async function () { await QuickSuggestTestUtils.ensureQuickSuggestInit(); }); -// Toggles the `suggest.quicksuggest.nonsponsored` pref. -add_task(function nonsponsoredToggled() { - doToggleTest("suggest.quicksuggest.nonsponsored"); -}); - // Toggles the `suggest.quicksuggest.sponsored` pref. add_task(async function sponsoredToggled() { doToggleTest("suggest.quicksuggest.sponsored"); @@ -77,7 +72,7 @@ add_task(async function telemetryEnvironmentOnStartup() { // array here. Assert.deepEqual( prefs.sort(), - ["suggest.quicksuggest.nonsponsored", "suggest.quicksuggest.sponsored"], + ["suggest.quicksuggest.sponsored"], "Expected startup prefs" ); diff --git a/browser/components/urlbar/tests/quicksuggest/unit/test_quicksuggest.js b/browser/components/urlbar/tests/quicksuggest/unit/test_quicksuggest.js @@ -260,20 +260,20 @@ add_task(async function online_telemetryType_wikipedia() { ); }); -// Tests with only non-sponsored suggestions enabled with a matching search -// string. -add_task(async function nonsponsoredOnly_match() { - UrlbarPrefs.set("suggest.quicksuggest.nonsponsored", true); - UrlbarPrefs.set("suggest.quicksuggest.sponsored", false); +// Tests with both `all` and sponsored enabled with a sponsored search string. +// Sponsored suggestions should be matched. +add_task(async function allEnabled_sponsoredEnabled_sponsoredSearch() { + UrlbarPrefs.set("suggest.quicksuggest.all", true); + UrlbarPrefs.set("suggest.quicksuggest.sponsored", true); await QuickSuggestTestUtils.forceSync(); - let context = createContext(NONSPONSORED_SEARCH_STRING, { + let context = createContext(SPONSORED_SEARCH_STRING, { providers: [UrlbarProviderQuickSuggest.name], isPrivate: false, }); await check_results({ context, - matches: [QuickSuggestTestUtils.wikipediaResult()], + matches: [QuickSuggestTestUtils.ampResult({ suggestedIndex: -1 })], }); // The title should include the full keyword and em dash, and the part of the @@ -281,7 +281,7 @@ add_task(async function nonsponsoredOnly_match() { let result = context.results[0]; Assert.equal( result.title, - `${NONSPONSORED_SEARCH_STRING} — Wikipedia Suggestion`, + `${SPONSORED_SEARCH_STRING} — Amp Suggestion`, "result.title should be correct" ); Assert.deepEqual( @@ -291,33 +291,20 @@ add_task(async function nonsponsoredOnly_match() { ); }); -// Tests with only non-sponsored suggestions enabled with a non-matching search -// string. -add_task(async function nonsponsoredOnly_noMatch() { - UrlbarPrefs.set("suggest.quicksuggest.nonsponsored", true); - UrlbarPrefs.set("suggest.quicksuggest.sponsored", false); - await QuickSuggestTestUtils.forceSync(); - - let context = createContext(SPONSORED_SEARCH_STRING, { - providers: [UrlbarProviderQuickSuggest.name], - isPrivate: false, - }); - await check_results({ context, matches: [] }); -}); - -// Tests with only sponsored suggestions enabled with a matching search string. -add_task(async function sponsoredOnly_sponsored() { - UrlbarPrefs.set("suggest.quicksuggest.nonsponsored", false); +// Tests with both `all` and sponsored enabled with a non-sponsored search +// string. Non-sponsored suggestions should be matched. +add_task(async function allEnabled_sponsoredEnabled_nonsponsoredSearch() { + UrlbarPrefs.set("suggest.quicksuggest.all", true); UrlbarPrefs.set("suggest.quicksuggest.sponsored", true); await QuickSuggestTestUtils.forceSync(); - let context = createContext(SPONSORED_SEARCH_STRING, { + let context = createContext(NONSPONSORED_SEARCH_STRING, { providers: [UrlbarProviderQuickSuggest.name], isPrivate: false, }); await check_results({ context, - matches: [QuickSuggestTestUtils.ampResult({ suggestedIndex: -1 })], + matches: [QuickSuggestTestUtils.wikipediaResult()], }); // The title should include the full keyword and em dash, and the part of the @@ -325,7 +312,7 @@ add_task(async function sponsoredOnly_sponsored() { let result = context.results[0]; Assert.equal( result.title, - `${SPONSORED_SEARCH_STRING} — Amp Suggestion`, + `${NONSPONSORED_SEARCH_STRING} — Wikipedia Suggestion`, "result.title should be correct" ); Assert.deepEqual( @@ -335,42 +322,39 @@ add_task(async function sponsoredOnly_sponsored() { ); }); -// Tests with only sponsored suggestions enabled with a non-matching search -// string. -add_task(async function sponsoredOnly_nonsponsored() { - UrlbarPrefs.set("suggest.quicksuggest.nonsponsored", false); +// Tests with both `all` and sponsored enabled with a search string that doesn't +// match anything. +add_task(async function allEnabled_sponsoredEnabled_nonmatchingSearch() { + UrlbarPrefs.set("suggest.quicksuggest.all", true); UrlbarPrefs.set("suggest.quicksuggest.sponsored", true); await QuickSuggestTestUtils.forceSync(); - let context = createContext(NONSPONSORED_SEARCH_STRING, { + let context = createContext("this doesn't match anything", { providers: [UrlbarProviderQuickSuggest.name], isPrivate: false, }); await check_results({ context, matches: [] }); }); -// Tests with both sponsored and non-sponsored suggestions enabled with a -// search string that matches the sponsored suggestion. -add_task(async function both_sponsored() { - UrlbarPrefs.set("suggest.quicksuggest.nonsponsored", true); - UrlbarPrefs.set("suggest.quicksuggest.sponsored", true); +// Tests with `all` enabled and sponsored disabled with a sponsored search +// string. No suggestions should be matched. +add_task(async function allEnabled_sponsoredDisabled_sponsoredSearch() { + UrlbarPrefs.set("suggest.quicksuggest.all", true); + UrlbarPrefs.set("suggest.quicksuggest.sponsored", false); await QuickSuggestTestUtils.forceSync(); let context = createContext(SPONSORED_SEARCH_STRING, { providers: [UrlbarProviderQuickSuggest.name], isPrivate: false, }); - await check_results({ - context, - matches: [QuickSuggestTestUtils.ampResult({ suggestedIndex: -1 })], - }); + await check_results({ context, matches: [] }); }); -// Tests with both sponsored and non-sponsored suggestions enabled with a -// search string that matches the non-sponsored suggestion. -add_task(async function both_nonsponsored() { - UrlbarPrefs.set("suggest.quicksuggest.nonsponsored", true); - UrlbarPrefs.set("suggest.quicksuggest.sponsored", true); +// Tests with `all` enabled and sponsored disabled with a non-sponsored search +// string. Non-sponsored suggestions should be matched. +add_task(async function allEnabled_sponsoredDisabled_nonsponsoredSearch() { + UrlbarPrefs.set("suggest.quicksuggest.all", true); + UrlbarPrefs.set("suggest.quicksuggest.sponsored", false); await QuickSuggestTestUtils.forceSync(); let context = createContext(NONSPONSORED_SEARCH_STRING, { @@ -383,25 +367,42 @@ add_task(async function both_nonsponsored() { }); }); -// Tests with both sponsored and non-sponsored suggestions enabled with a -// search string that doesn't match either suggestion. -add_task(async function both_noMatch() { - UrlbarPrefs.set("suggest.quicksuggest.nonsponsored", true); +// Tests with `all` disabled and sponsored enabled with a sponsored search +// string. No suggestions should be matched. The settings UI does not make this +// case possible, but the prefs are independent, so it's technically possible. +add_task(async function allDisabled_sponsoredEnabled_sponsoredSearch() { + UrlbarPrefs.set("suggest.quicksuggest.all", false); UrlbarPrefs.set("suggest.quicksuggest.sponsored", true); await QuickSuggestTestUtils.forceSync(); - let context = createContext("this doesn't match anything", { + let context = createContext(SPONSORED_SEARCH_STRING, { providers: [UrlbarProviderQuickSuggest.name], isPrivate: false, }); await check_results({ context, matches: [] }); }); -// Tests with both the main and sponsored prefs disabled with a search string -// that matches the sponsored suggestion. -add_task(async function neither_sponsored() { - UrlbarPrefs.set("suggest.quicksuggest.nonsponsored", false); +// Tests with `all` disabled and sponsored enabled with a non-sponsored search +// string. No suggestions should be matched. The settings UI does not make this +// case possible, but the prefs are independent, so it's technically possible. +add_task(async function allDisabled_sponsoredEnabled_nonsponsoredSearch() { + UrlbarPrefs.set("suggest.quicksuggest.all", false); + UrlbarPrefs.set("suggest.quicksuggest.sponsored", true); + await QuickSuggestTestUtils.forceSync(); + + let context = createContext(NONSPONSORED_SEARCH_STRING, { + providers: [UrlbarProviderQuickSuggest.name], + isPrivate: false, + }); + await check_results({ context, matches: [] }); +}); + +// Tests with both `all` and sponsored disabled with a sponsored search string. +// No suggestions should be matched. +add_task(async function allDisabled_sponsoredDisabled_sponsoredSearch() { + UrlbarPrefs.set("suggest.quicksuggest.all", false); UrlbarPrefs.set("suggest.quicksuggest.sponsored", false); + await QuickSuggestTestUtils.forceSync(); let context = createContext(SPONSORED_SEARCH_STRING, { providers: [UrlbarProviderQuickSuggest.name], @@ -410,11 +411,12 @@ add_task(async function neither_sponsored() { await check_results({ context, matches: [] }); }); -// Tests with both the main and sponsored prefs disabled with a search string -// that matches the non-sponsored suggestion. -add_task(async function neither_nonsponsored() { - UrlbarPrefs.set("suggest.quicksuggest.nonsponsored", false); +// Tests with both `all` and sponsored disabled with a non-sponsored search +// string. No suggestions should be matched. +add_task(async function allDisabled_sponsoredDisabled_nonsponsoredSearch() { + UrlbarPrefs.set("suggest.quicksuggest.all", false); UrlbarPrefs.set("suggest.quicksuggest.sponsored", false); + await QuickSuggestTestUtils.forceSync(); let context = createContext(NONSPONSORED_SEARCH_STRING, { providers: [UrlbarProviderQuickSuggest.name], @@ -425,7 +427,7 @@ add_task(async function neither_nonsponsored() { // Search string matching should be case insensitive and ignore leading spaces. add_task(async function caseInsensitiveAndLeadingSpaces() { - UrlbarPrefs.set("suggest.quicksuggest.nonsponsored", true); + UrlbarPrefs.set("suggest.quicksuggest.all", true); UrlbarPrefs.set("suggest.quicksuggest.sponsored", true); await QuickSuggestTestUtils.forceSync(); @@ -442,7 +444,7 @@ add_task(async function caseInsensitiveAndLeadingSpaces() { // The provider should not be active for search strings that are empty or // contain only spaces. add_task(async function emptySearchStringsAndSpaces() { - UrlbarPrefs.set("suggest.quicksuggest.nonsponsored", true); + UrlbarPrefs.set("suggest.quicksuggest.all", true); UrlbarPrefs.set("suggest.quicksuggest.sponsored", true); await QuickSuggestTestUtils.forceSync(); @@ -471,7 +473,7 @@ add_task(async function emptySearchStringsAndSpaces() { // Results should be returned even when `browser.search.suggest.enabled` is // false. add_task(async function browser_search_suggest_disabled() { - UrlbarPrefs.set("suggest.quicksuggest.nonsponsored", true); + UrlbarPrefs.set("suggest.quicksuggest.all", true); UrlbarPrefs.set("suggest.quicksuggest.sponsored", true); UrlbarPrefs.set("browser.search.suggest.enabled", false); await QuickSuggestTestUtils.forceSync(); @@ -491,7 +493,7 @@ add_task(async function browser_search_suggest_disabled() { // Results should be returned even when `browser.urlbar.suggest.searches` is // false. add_task(async function browser_suggest_searches_disabled() { - UrlbarPrefs.set("suggest.quicksuggest.nonsponsored", true); + UrlbarPrefs.set("suggest.quicksuggest.all", true); UrlbarPrefs.set("suggest.quicksuggest.sponsored", true); UrlbarPrefs.set("suggest.searches", false); await QuickSuggestTestUtils.forceSync(); @@ -511,7 +513,7 @@ add_task(async function browser_suggest_searches_disabled() { // Neither sponsored nor non-sponsored results should appear in private contexts // even when suggestions in private windows are enabled. add_task(async function privateContext() { - UrlbarPrefs.set("suggest.quicksuggest.nonsponsored", true); + UrlbarPrefs.set("suggest.quicksuggest.all", true); UrlbarPrefs.set("suggest.quicksuggest.sponsored", true); await QuickSuggestTestUtils.forceSync(); @@ -536,7 +538,7 @@ add_task(async function privateContext() { // When search suggestions come before general results and the only general // result is a quick suggest result, it should come last. add_task(async function suggestionsBeforeGeneral_only() { - UrlbarPrefs.set("suggest.quicksuggest.nonsponsored", true); + UrlbarPrefs.set("suggest.quicksuggest.all", true); UrlbarPrefs.set("suggest.quicksuggest.sponsored", true); UrlbarPrefs.set("browser.search.suggest.enabled", true); UrlbarPrefs.set("suggest.searches", true); @@ -575,7 +577,7 @@ add_task(async function suggestionsBeforeGeneral_only() { // general results besides quick suggest, the quick suggest result should come // last. add_task(async function suggestionsBeforeGeneral_others() { - UrlbarPrefs.set("suggest.quicksuggest.nonsponsored", true); + UrlbarPrefs.set("suggest.quicksuggest.all", true); UrlbarPrefs.set("suggest.quicksuggest.sponsored", true); UrlbarPrefs.set("browser.search.suggest.enabled", true); UrlbarPrefs.set("suggest.searches", true); @@ -631,7 +633,7 @@ add_task(async function suggestionsBeforeGeneral_others() { // When general results come before search suggestions and the only general // result is a quick suggest result, it should come before suggestions. add_task(async function generalBeforeSuggestions_only() { - UrlbarPrefs.set("suggest.quicksuggest.nonsponsored", true); + UrlbarPrefs.set("suggest.quicksuggest.all", true); UrlbarPrefs.set("suggest.quicksuggest.sponsored", true); UrlbarPrefs.set("browser.search.suggest.enabled", true); UrlbarPrefs.set("suggest.searches", true); @@ -670,7 +672,7 @@ add_task(async function generalBeforeSuggestions_only() { // general results besides quick suggest, the quick suggest result should be the // last general result. add_task(async function generalBeforeSuggestions_others() { - UrlbarPrefs.set("suggest.quicksuggest.nonsponsored", true); + UrlbarPrefs.set("suggest.quicksuggest.all", true); UrlbarPrefs.set("suggest.quicksuggest.sponsored", true); UrlbarPrefs.set("browser.search.suggest.enabled", true); UrlbarPrefs.set("suggest.searches", true); @@ -959,7 +961,7 @@ async function doDedupeAgainstURLTest({ // First, do a search with quick suggest disabled to make sure the search // string matches the visit. info("Doing first query"); - UrlbarPrefs.set("suggest.quicksuggest.nonsponsored", false); + UrlbarPrefs.set("suggest.quicksuggest.all", false); UrlbarPrefs.set("suggest.quicksuggest.sponsored", false); let context = createContext(searchString, { isPrivate: false }); await check_results({ @@ -978,7 +980,7 @@ async function doDedupeAgainstURLTest({ }); // Now do another search with quick suggest enabled. - UrlbarPrefs.set("suggest.quicksuggest.nonsponsored", true); + UrlbarPrefs.set("suggest.quicksuggest.all", true); UrlbarPrefs.set("suggest.quicksuggest.sponsored", true); await QuickSuggestTestUtils.forceSync(); @@ -1007,7 +1009,7 @@ async function doDedupeAgainstURLTest({ info("Doing second query"); await check_results({ context, matches: expectedResults }); - UrlbarPrefs.clear("suggest.quicksuggest.nonsponsored"); + UrlbarPrefs.clear("suggest.quicksuggest.all"); UrlbarPrefs.clear("suggest.quicksuggest.sponsored"); await QuickSuggestTestUtils.forceSync(); @@ -1017,7 +1019,7 @@ async function doDedupeAgainstURLTest({ // Timestamp templates in URLs should be replaced with real timestamps. add_task(async function timestamps() { - UrlbarPrefs.set("suggest.quicksuggest.nonsponsored", true); + UrlbarPrefs.set("suggest.quicksuggest.all", true); UrlbarPrefs.set("suggest.quicksuggest.sponsored", true); await QuickSuggestTestUtils.forceSync(); @@ -1081,7 +1083,7 @@ add_task(async function dedupeAgainstURL_timestamps() { // First, do a search with quick suggest disabled to make sure the search // string matches all the other URLs. info("Doing first query"); - UrlbarPrefs.set("suggest.quicksuggest.nonsponsored", false); + UrlbarPrefs.set("suggest.quicksuggest.all", false); UrlbarPrefs.set("suggest.quicksuggest.sponsored", false); let context = createContext(TIMESTAMP_SEARCH_STRING, { isPrivate: false }); @@ -1112,7 +1114,7 @@ add_task(async function dedupeAgainstURL_timestamps() { // Now do another search with quick suggest enabled. info("Doing second query"); - UrlbarPrefs.set("suggest.quicksuggest.nonsponsored", true); + UrlbarPrefs.set("suggest.quicksuggest.all", true); UrlbarPrefs.set("suggest.quicksuggest.sponsored", true); await QuickSuggestTestUtils.forceSync(); context = createContext(TIMESTAMP_SEARCH_STRING, { isPrivate: false }); @@ -1209,7 +1211,7 @@ add_task(async function dedupeAgainstURL_timestamps() { }); // Clean up. - UrlbarPrefs.clear("suggest.quicksuggest.nonsponsored"); + UrlbarPrefs.clear("suggest.quicksuggest.all"); UrlbarPrefs.clear("suggest.quicksuggest.sponsored"); await QuickSuggestTestUtils.forceSync(); @@ -1219,7 +1221,7 @@ add_task(async function dedupeAgainstURL_timestamps() { // Tests `UrlbarResult` dismissal. add_task(async function dismissResult() { - UrlbarPrefs.set("suggest.quicksuggest.nonsponsored", true); + UrlbarPrefs.set("suggest.quicksuggest.all", true); UrlbarPrefs.set("suggest.quicksuggest.sponsored", true); await QuickSuggestTestUtils.forceSync(); @@ -1281,8 +1283,8 @@ add_task(async function dismissResult() { // Tests dismissing a `UrlbarResult` whose URL has a timestamp template. add_task(async function dismissResultWithTimestamp() { + UrlbarPrefs.set("suggest.quicksuggest.all", true); UrlbarPrefs.set("suggest.quicksuggest.sponsored", true); - UrlbarPrefs.set("suggest.quicksuggest.nonsponsored", true); await QuickSuggestTestUtils.forceSync(); // Do a search. @@ -1373,7 +1375,7 @@ async function doSponsoredPriorityTest({ remoteSettingsData, expectedMatches, }) { - UrlbarPrefs.set("suggest.quicksuggest.nonsponsored", true); + UrlbarPrefs.set("suggest.quicksuggest.all", true); UrlbarPrefs.set("suggest.quicksuggest.sponsored", true); await QuickSuggestTestUtils.forceSync(); @@ -1571,7 +1573,7 @@ add_task(async function rustProviders() { tests: [ { prefs: { - "suggest.quicksuggest.nonsponsored": true, + "suggest.quicksuggest.all": true, "suggest.quicksuggest.sponsored": true, }, expectedUrls: [ @@ -1581,21 +1583,21 @@ add_task(async function rustProviders() { }, { prefs: { - "suggest.quicksuggest.nonsponsored": true, + "suggest.quicksuggest.all": true, "suggest.quicksuggest.sponsored": false, }, expectedUrls: ["https://example.com/wikipedia"], }, { prefs: { - "suggest.quicksuggest.nonsponsored": false, + "suggest.quicksuggest.all": false, "suggest.quicksuggest.sponsored": true, }, - expectedUrls: ["https://example.com/amp"], + expectedUrls: [], }, { prefs: { - "suggest.quicksuggest.nonsponsored": false, + "suggest.quicksuggest.all": false, "suggest.quicksuggest.sponsored": false, }, expectedUrls: [], @@ -1607,6 +1609,7 @@ add_task(async function rustProviders() { // Tests the keyword/search-string-length threshold. Keywords/search strings // must be at least two characters long to be matched. add_task(async function keywordLengthThreshold() { + UrlbarPrefs.set("suggest.quicksuggest.all", true); UrlbarPrefs.set("suggest.quicksuggest.sponsored", true); await QuickSuggestTestUtils.forceSync(); @@ -1642,8 +1645,8 @@ add_task(async function keywordLengthThreshold() { // a top pick. It shouldn't matter whether the query is one of the suggestion's // full keywords. add_task(async function ampTopPickCharThreshold() { + UrlbarPrefs.set("suggest.quicksuggest.all", true); UrlbarPrefs.set("suggest.quicksuggest.sponsored", true); - UrlbarPrefs.set("suggest.quicksuggest.nonsponsored", true); await QuickSuggestTestUtils.forceSync(); UrlbarPrefs.set( @@ -1759,8 +1762,8 @@ add_task(async function ampTopPickCharThreshold() { // AMP should not be shown as a top pick when the threshold is zero. add_task(async function ampTopPickCharThreshold_zero() { + UrlbarPrefs.set("suggest.quicksuggest.all", true); UrlbarPrefs.set("suggest.quicksuggest.sponsored", true); - UrlbarPrefs.set("suggest.quicksuggest.nonsponsored", true); await QuickSuggestTestUtils.forceSync(); UrlbarPrefs.set("quicksuggest.ampTopPickCharThreshold", 0); @@ -1817,7 +1820,7 @@ add_task(async function ampTopPickCharThreshold_zero() { // Tests `ampMatchingStrategy`. add_task(async function ampMatchingStrategy() { - UrlbarPrefs.set("suggest.quicksuggest.nonsponsored", false); + UrlbarPrefs.set("suggest.quicksuggest.all", true); UrlbarPrefs.set("suggest.quicksuggest.sponsored", true); await QuickSuggestTestUtils.forceSync(); @@ -1938,14 +1941,15 @@ async function doAmpMatchingStrategyTest({ add_task(async function offline_amp_disabled() { for (let pref of [ + "suggest.quicksuggest.all", "suggest.quicksuggest.sponsored", "amp.featureGate", "suggest.amp", ]) { info("Testing with pref: " + pref); + UrlbarPrefs.set("suggest.quicksuggest.all", true); UrlbarPrefs.set("suggest.quicksuggest.sponsored", true); - UrlbarPrefs.set("suggest.quicksuggest.nonsponsored", false); await QuickSuggestTestUtils.forceSync(); // First make sure we can match an AMP suggestion. @@ -1977,14 +1981,14 @@ add_task(async function offline_amp_disabled() { add_task(async function offline_wikipedia_disabled() { for (let pref of [ - "suggest.quicksuggest.nonsponsored", + "suggest.quicksuggest.all", "wikipedia.featureGate", "suggest.wikipedia", ]) { info("Testing with pref: " + pref); + UrlbarPrefs.set("suggest.quicksuggest.all", true); UrlbarPrefs.set("suggest.quicksuggest.sponsored", false); - UrlbarPrefs.set("suggest.quicksuggest.nonsponsored", true); await QuickSuggestTestUtils.forceSync(); // First make sure we can match a Wikipedia suggestion. @@ -2017,14 +2021,15 @@ add_task(async function offline_wikipedia_disabled() { add_task(async function online_amp_disabled() { await doMerinoTest(async () => { for (let pref of [ + "suggest.quicksuggest.all", "suggest.quicksuggest.sponsored", "amp.featureGate", "suggest.amp", ]) { info("Testing with pref: " + pref); + UrlbarPrefs.set("suggest.quicksuggest.all", true); UrlbarPrefs.set("suggest.quicksuggest.sponsored", true); - UrlbarPrefs.set("suggest.quicksuggest.nonsponsored", false); await QuickSuggestTestUtils.forceSync(); // First make sure we can match an AMP suggestion. @@ -2049,12 +2054,25 @@ add_task(async function online_amp_disabled() { UrlbarPrefs.set(pref, false); await QuickSuggestTestUtils.forceSync(); + // Unless the pref was `all`, the Wikipedia Merino suggestion should now + // be matched. + let expected = + pref == "suggest.quicksuggest.all" + ? [] + : [ + QuickSuggestTestUtils.wikipediaResult({ + source: "merino", + provider: "wikipedia", + telemetryType: "wikipedia", + icon: "https://example.com/wikipedia-icon", + }), + ]; await check_results({ context: createContext("test", { providers: [UrlbarProviderQuickSuggest.name], isPrivate: false, }), - matches: [], + matches: expected, }); UrlbarPrefs.clear(pref); @@ -2067,14 +2085,14 @@ add_task(async function online_amp_disabled() { add_task(async function online_wikipedia_disabled() { await doMerinoTest(async () => { for (let pref of [ - "suggest.quicksuggest.nonsponsored", + "suggest.quicksuggest.all", "wikipedia.featureGate", "suggest.wikipedia", ]) { info("Testing with pref: " + pref); + UrlbarPrefs.set("suggest.quicksuggest.all", true); UrlbarPrefs.set("suggest.quicksuggest.sponsored", false); - UrlbarPrefs.set("suggest.quicksuggest.nonsponsored", true); await QuickSuggestTestUtils.forceSync(); // First make sure we can match a Wikipedia suggestion. diff --git a/browser/components/urlbar/tests/quicksuggest/unit/test_quicksuggest_defaultPrefs.js b/browser/components/urlbar/tests/quicksuggest/unit/test_quicksuggest_defaultPrefs.js @@ -19,7 +19,7 @@ const EXPECTED_PREFS_SUGGEST_DISABLED = { "quicksuggest.online.available": false, "quicksuggest.online.enabled": true, "quicksuggest.settingsUi": QuickSuggest.SETTINGS_UI.NONE, - "suggest.quicksuggest.nonsponsored": false, + "suggest.quicksuggest.all": false, "suggest.quicksuggest.sponsored": false, "addons.featureGate": false, "amp.featureGate": false, @@ -36,7 +36,7 @@ const EXPECTED_PREFS_EU_NATIVE = { ...EXPECTED_PREFS_SUGGEST_DISABLED, "quicksuggest.enabled": true, "quicksuggest.settingsUi": QuickSuggest.SETTINGS_UI.OFFLINE_ONLY, - "suggest.quicksuggest.nonsponsored": true, + "suggest.quicksuggest.all": true, "suggest.quicksuggest.sponsored": true, "importantDates.featureGate": true, "weather.featureGate": true, @@ -57,7 +57,7 @@ const EXPECTED_PREFS_BASE_EN_NATIVE = { ...EXPECTED_PREFS_SUGGEST_DISABLED, "quicksuggest.enabled": true, "quicksuggest.settingsUi": QuickSuggest.SETTINGS_UI.OFFLINE_ONLY, - "suggest.quicksuggest.nonsponsored": true, + "suggest.quicksuggest.all": true, "suggest.quicksuggest.sponsored": true, "amp.featureGate": true, "importantDates.featureGate": true, diff --git a/browser/components/urlbar/tests/quicksuggest/unit/test_quicksuggest_merino.js b/browser/components/urlbar/tests/quicksuggest/unit/test_quicksuggest_merino.js @@ -40,7 +40,7 @@ add_setup(async () => { // Set up the remote settings client with the test data. await QuickSuggestTestUtils.ensureQuickSuggestInit({ prefs: [ - ["suggest.quicksuggest.nonsponsored", true], + ["suggest.quicksuggest.all", true], ["suggest.quicksuggest.sponsored", true], ["quicksuggest.ampTopPickCharThreshold", 0], ], @@ -320,42 +320,6 @@ add_task(async function timestamps() { merinoClient().resetSession(); }); -// When both suggestion types are disabled but online is enabled, we should -// still send requests to Merino, and the requests should include an empty -// `providers` to tell Merino not to fetch any suggestions. -add_task(async function suggestedDisabled_onlineEnabled() { - UrlbarPrefs.set("quicksuggest.online.available", true); - UrlbarPrefs.set("quicksuggest.online.enabled", true); - - UrlbarPrefs.set("suggest.quicksuggest.nonsponsored", false); - UrlbarPrefs.set("suggest.quicksuggest.sponsored", false); - - let context = createContext("test", { - providers: [UrlbarProviderQuickSuggest.name], - isPrivate: false, - }); - await check_results({ - context, - matches: [], - }); - - // Check that the request is received and includes an empty `providers`. - MerinoTestUtils.server.checkAndClearRequests([ - { - params: { - [MerinoTestUtils.SEARCH_PARAMS.QUERY]: "test", - [MerinoTestUtils.SEARCH_PARAMS.SEQUENCE_NUMBER]: 0, - [MerinoTestUtils.SEARCH_PARAMS.PROVIDERS]: "", - }, - }, - ]); - - UrlbarPrefs.set("suggest.quicksuggest.nonsponsored", true); - UrlbarPrefs.set("suggest.quicksuggest.sponsored", true); - await QuickSuggestTestUtils.forceSync(); - merinoClient().resetSession(); -}); - // Tests dismissals of managed Merino suggestions (suggestions that are managed // by a `SuggestFeature`). add_task(async function dismissals_managed() { @@ -813,8 +777,24 @@ add_task(async function bestMatch() { merinoClient().resetSession(); }); -// Tests a sponsored suggestion that isn't managed by a feature. -add_task(async function unmanaged_sponsored() { +// Tests a sponsored suggestion that isn't managed by a feature. When the `all` +// pref is disabled, a result for the suggestion should not be added. +add_task(async function unmanaged_sponsored_allDisabled() { + await doUnmanagedTest({ + pref: "suggest.quicksuggest.all", + suggestion: { + title: "Sponsored without feature", + url: "https://example.com/sponsored-without-feature", + provider: "sponsored-unrecognized-provider", + is_sponsored: true, + }, + shouldBeAdded: false, + }); +}); + +// Tests a sponsored suggestion that isn't managed by a feature. When the +// sponsored pref is disabled, a result for the suggestion should not be added. +add_task(async function unmanaged_sponsored_sponsoredDisabled() { await doUnmanagedTest({ pref: "suggest.quicksuggest.sponsored", suggestion: { @@ -823,24 +803,43 @@ add_task(async function unmanaged_sponsored() { provider: "sponsored-unrecognized-provider", is_sponsored: true, }, + shouldBeAdded: false, + }); +}); + +// Tests a nonsponsored suggestion that isn't managed by a feature. When the +// `all` pref is disabled, a result for the suggestion should not be added. +add_task(async function unmanaged_nonsponsored_allDisabled() { + await doUnmanagedTest({ + pref: "suggest.quicksuggest.all", + suggestion: { + title: "Nonsponsored without feature", + url: "https://example.com/nonsponsored-without-feature", + provider: "nonsponsored-unrecognized-provider", + // no is_sponsored + }, + shouldBeAdded: false, }); }); -// Tests a nonsponsored suggestion that isn't managed by a feature. -add_task(async function unmanaged_nonsponsored() { +// Tests a nonsponsored suggestion that isn't managed by a feature. When the +// `all` pref is enabled and the sponsored pref is disabled, a result for the +// suggestion should be added. +add_task(async function unmanaged_nonsponsored_sponsoredDisabled() { await doUnmanagedTest({ - pref: "suggest.quicksuggest.nonsponsored", + pref: "suggest.quicksuggest.sponsored", suggestion: { title: "Nonsponsored without feature", url: "https://example.com/nonsponsored-without-feature", provider: "nonsponsored-unrecognized-provider", // no is_sponsored }, + shouldBeAdded: true, }); }); -async function doUnmanagedTest({ pref, suggestion }) { - UrlbarPrefs.set("suggest.quicksuggest.nonsponsored", true); +async function doUnmanagedTest({ pref, suggestion, shouldBeAdded }) { + UrlbarPrefs.set("suggest.quicksuggest.all", true); UrlbarPrefs.set("suggest.quicksuggest.sponsored", true); await QuickSuggestTestUtils.forceSync(); @@ -866,7 +865,7 @@ async function doUnmanagedTest({ pref, suggestion }) { }, }; - // Do an initial search. Sponsored and nonsponsored suggestions are both + // Do an initial search. The `all` pref and sponsored suggestions are both // enabled, so the suggestion should be matched. info("Doing search 1"); await check_results({ @@ -877,8 +876,8 @@ async function doUnmanagedTest({ pref, suggestion }) { matches: [expectedResult], }); - // Set the pref to false and do another search. The suggestion shouldn't be - // matched. + // Set the passed-in pref to false and do another search. The suggestion + // should be matched as expected. UrlbarPrefs.set(pref, false); await QuickSuggestTestUtils.forceSync(); @@ -888,7 +887,7 @@ async function doUnmanagedTest({ pref, suggestion }) { providers: [UrlbarProviderQuickSuggest.name], isPrivate: false, }), - matches: [], + matches: shouldBeAdded ? [expectedResult] : [], }); // Flip the pref back to true and do a third search. diff --git a/browser/components/urlbar/tests/quicksuggest/unit/test_quicksuggest_relevanceRanking.js b/browser/components/urlbar/tests/quicksuggest/unit/test_quicksuggest_relevanceRanking.js @@ -99,7 +99,7 @@ add_setup(async () => { await QuickSuggestTestUtils.ensureQuickSuggestInit({ merinoSuggestions: MERINO_SUGGESTIONS, prefs: [ - ["suggest.quicksuggest.nonsponsored", true], + ["suggest.quicksuggest.all", true], ["suggest.quicksuggest.sponsored", true], // Turn off higher-placement sponsored so this test doesn't need to worry diff --git a/browser/components/urlbar/tests/quicksuggest/unit/test_quicksuggest_remoteSettingsFilter.js b/browser/components/urlbar/tests/quicksuggest/unit/test_quicksuggest_remoteSettingsFilter.js @@ -73,8 +73,8 @@ add_setup(async function () { await QuickSuggestTestUtils.ensureQuickSuggestInit({ remoteSettingsRecords, prefs: [ + ["suggest.quicksuggest.all", true], ["suggest.quicksuggest.sponsored", true], - ["suggest.quicksuggest.nonsponsored", true], ["quicksuggest.ampTopPickCharThreshold", 0], ], }); diff --git a/browser/components/urlbar/tests/quicksuggest/unit/test_quicksuggest_scoreMap.js b/browser/components/urlbar/tests/quicksuggest/unit/test_quicksuggest_scoreMap.js @@ -157,8 +157,8 @@ add_setup(async function init() { remoteSettingsRecords: REMOTE_SETTINGS_RECORDS, merinoSuggestions: [], prefs: [ + ["suggest.quicksuggest.all", true], ["suggest.quicksuggest.sponsored", true], - ["suggest.quicksuggest.nonsponsored", true], ["quicksuggest.ampTopPickCharThreshold", 0], ], }); diff --git a/browser/components/urlbar/tests/quicksuggest/unit/test_rust_ingest.js b/browser/components/urlbar/tests/quicksuggest/unit/test_rust_ingest.js @@ -37,8 +37,8 @@ add_setup(async function () { }, ], prefs: [ + ["suggest.quicksuggest.all", true], ["suggest.quicksuggest.sponsored", true], - ["suggest.quicksuggest.nonsponsored", true], ], }); }); diff --git a/browser/components/urlbar/tests/quicksuggest/unit/test_suggestBackendMl.js b/browser/components/urlbar/tests/quicksuggest/unit/test_suggestBackendMl.js @@ -26,7 +26,7 @@ add_setup(async function init() { // Enable Suggest but not the ML backend yet. await QuickSuggestTestUtils.ensureQuickSuggestInit({ prefs: [ - ["suggest.quicksuggest.nonsponsored", true], + ["suggest.quicksuggest.all", true], ["suggest.quicksuggest.sponsored", true], ], }); diff --git a/browser/components/urlbar/tests/quicksuggest/unit/xpcshell.toml b/browser/components/urlbar/tests/quicksuggest/unit/xpcshell.toml @@ -23,8 +23,10 @@ requesttimeoutfactor = 2 # Slow on Linux and Windows ["test_quicksuggest_dynamicSuggestions.js"] ["test_quicksuggest_exposures.js"] +requesttimeoutfactor = 2 # Slow on Mac in verify mode ["test_quicksuggest_exposures_locales.js"] +requesttimeoutfactor = 2 # Slow on Mac in verify mode ["test_quicksuggest_flight_status.js"] diff --git a/browser/components/urlbar/tests/unit/test_exposure.js b/browser/components/urlbar/tests/unit/test_exposure.js @@ -33,7 +33,7 @@ add_setup(async function setup() { }, ], prefs: [ - ["suggest.quicksuggest.nonsponsored", true], + ["suggest.quicksuggest.all", true], ["suggest.quicksuggest.sponsored", true], ["quicksuggest.ampTopPickCharThreshold", 0], ], diff --git a/toolkit/components/nimbus/FeatureManifest.yaml b/toolkit/components/nimbus/FeatureManifest.yaml @@ -482,7 +482,9 @@ urlbar: Whether Suggest will use the ML backend in addition to Rust. quickSuggestNonSponsoredEnabled: type: boolean - description: Whether non-sponsored suggestions should be enabled by default. If this variable is specified, it will override the value implied by the scenario. It will never override the user's local preference to disable (or enable) non-sponsored suggestions, if the user has already toggled that preference. + description: >- + Deprecated: In 146 and later this variable no longer does anything. It + should be removed once all current experiments that use it finish. quickSuggestNonSponsoredIndex: type: int fallbackPref: browser.urlbar.quicksuggest.nonSponsoredIndex