Bug 1181644 - Include local search suggestions in the awesomebar like all other access points. r?mak
MozReview-Commit-ID: 3RT3xXCA1lB
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -312,16 +312,19 @@ pref("browser.urlbar.filter.javascript",
// the maximum number of results to show in autocomplete when doing richResults
pref("browser.urlbar.maxRichResults", 10);
// The amount of time (ms) to wait after the user has stopped typing
// before starting to perform autocomplete. 50 is the default set in
// autocomplete.xml.
pref("browser.urlbar.delay", 50);
+// The maximum number of historical search results to show.
+pref("browser.urlbar.maxHistoricalSearchSuggestions", 1);
+
// The default behavior for the urlbar can be configured to use any combination
// of the match filters with each additional filter adding more results (union).
pref("browser.urlbar.suggest.history", true);
pref("browser.urlbar.suggest.bookmark", true);
pref("browser.urlbar.suggest.openpage", true);
pref("browser.urlbar.suggest.searches", true);
pref("browser.urlbar.userMadeSearchSuggestionsChoice", false);
// The suggestion opt-in notification will be shown on 4 different days.
--- a/browser/modules/test/browser/browser_UsageTelemetry_urlbar.js
+++ b/browser/modules/test/browser/browser_UsageTelemetry_urlbar.js
@@ -87,16 +87,20 @@ add_task(async function setup() {
// Enable event recording for the events tested here.
Services.telemetry.setEventRecordingEnabled("navigation", true);
// Clear history so that history added by previous tests doesn't mess up this
// test when it selects results in the urlbar.
await PlacesTestUtils.clearHistory();
+ // Clear historical search suggestions to avoid interference from previous
+ // tests.
+ await SpecialPowers.pushPrefEnv({"set": [["browser.urlbar.maxHistoricalSearchSuggestions", 0]]});
+
// Make sure to restore the engine once we're done.
registerCleanupFunction(async function() {
Services.telemetry.canRecordExtended = oldCanRecord;
Services.search.currentEngine = originalEngine;
Services.search.removeEngine(engine);
Services.prefs.setBoolPref(SUGGEST_URLBAR_PREF, suggestionsEnabled);
Services.prefs.clearUserPref(ONEOFF_URLBAR_PREF);
await PlacesTestUtils.clearHistory();