Bug 1219754 - Increase the minimum number of local matches in the awesomebar (
bug 1219754); rs=mak, a=lizzard
--- a/toolkit/components/places/UnifiedComplete.js
+++ b/toolkit/components/places/UnifiedComplete.js
@@ -66,17 +66,17 @@ const TITLE_SEARCH_ENGINE_SEPARATOR = "
const TELEMETRY_1ST_RESULT = "PLACES_AUTOCOMPLETE_1ST_RESULT_TIME_MS";
const TELEMETRY_6_FIRST_RESULTS = "PLACES_AUTOCOMPLETE_6_FIRST_RESULTS_TIME_MS";
// The default frecency value used when inserting matches with unknown frecency.
const FRECENCY_DEFAULT = 1000;
// Remote matches are appended when local matches are below a given frecency
// threshold (FRECENCY_DEFAULT) as soon as they arrive. However we'll
// always try to have at least MINIMUM_LOCAL_MATCHES local matches.
-const MINIMUM_LOCAL_MATCHES = 5;
+const MINIMUM_LOCAL_MATCHES = 6;
// A regex that matches "single word" hostnames for whitelisting purposes.
// The hostname will already have been checked for general validity, so we
// don't need to be exhaustive here, so allow dashes anywhere.
const REGEXP_SINGLEWORD_HOST = new RegExp("^[a-z0-9-]+$", "i");
// Regex used to match one or more whitespace.
const REGEXP_SPACES = /\s+/;
--- a/toolkit/components/places/tests/unifiedcomplete/test_searchSuggestions.js
+++ b/toolkit/components/places/tests/unifiedcomplete/test_searchSuggestions.js
@@ -374,16 +374,18 @@ add_task(function* mixup_frecency() {
{ uri: NetUtil.newURI("http://example.com/hi1"),
title: "high frecency 1",
style: [ "bookmark" ] },
{ uri: NetUtil.newURI("http://example.com/hi0"),
title: "high frecency 0",
style: [ "bookmark" ] },
{ uri: NetUtil.newURI("http://example.com/lo4"),
title: "low frecency 4" },
+ { uri: NetUtil.newURI("http://example.com/lo3"),
+ title: "low frecency 3" },
{
uri: makeActionURI(("searchengine"), {
engineName: ENGINE_NAME,
input: "frecency foo",
searchQuery: "frecency",
searchSuggestion: "frecency foo",
}),
title: ENGINE_NAME,
@@ -396,18 +398,16 @@ add_task(function* mixup_frecency() {
input: "frecency bar",
searchQuery: "frecency",
searchSuggestion: "frecency bar",
}),
title: ENGINE_NAME,
style: ["action", "searchengine"],
icon: "",
},
- { uri: NetUtil.newURI("http://example.com/lo3"),
- title: "low frecency 3" },
{ uri: NetUtil.newURI("http://example.com/lo2"),
title: "low frecency 2" },
{ uri: NetUtil.newURI("http://example.com/lo1"),
title: "low frecency 1" },
{ uri: NetUtil.newURI("http://example.com/lo0"),
title: "low frecency 0" },
],
});