Bug 1181644 - Include local search suggestions in the awesomebar like all other access points. r?mak draft
authorPanos Astithas <past@mozilla.com>
Thu, 24 Aug 2017 18:10:53 +0300
changeset 652249 6f8de87a68d9423e33ab1a92f8ca8c24a4f039e3
parent 652136 892c8916ba32b7733e06bfbfdd4083ffae3ca028
child 728045 e605c228663c47e6544507837d8e7768f9ccd90f
push id76010
push userbmo:past@mozilla.com
push dateThu, 24 Aug 2017 17:17:28 +0000
reviewersmak
bugs1181644
milestone57.0a1
Bug 1181644 - Include local search suggestions in the awesomebar like all other access points. r?mak MozReview-Commit-ID: 3RT3xXCA1lB
browser/app/profile/firefox.js
browser/modules/test/browser/browser_UsageTelemetry_urlbar.js
--- 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();