From 8ee5ae167896259bb9d1102167f680ea6801234e Mon Sep 17 00:00:00 2001 From: Harry Twyford Date: Fri, 9 Jul 2021 23:52:39 +0000 Subject: [PATCH] Bug 1717509 - Part 5 - Replace references to UnifiedComplete with references to UrlbarProviderPlaces. r=adw Differential Revision: https://phabricator.services.mozilla.com/D119310 --- .../test/xpcshell/test_ext_urlbar.js | 5 +- .../urlbar/UrlbarMuxerUnifiedComplete.jsm | 2 +- browser/components/urlbar/UrlbarPrefs.jsm | 2 +- .../urlbar/UrlbarProviderExtension.jsm | 2 +- .../urlbar/UrlbarProviderOpenTabs.jsm | 2 +- .../urlbar/UrlbarProviderPlaces.jsm | 8 +- .../urlbar/UrlbarProviderSearchTips.jsm | 3 +- .../UrlbarProviderTokenAliasEngines.jsm | 5 +- .../urlbar/UrlbarProviderTopSites.jsm | 4 +- browser/components/urlbar/UrlbarUtils.jsm | 11 ++- browser/components/urlbar/docs/index.rst | 4 +- browser/components/urlbar/docs/telemetry.rst | 4 +- .../tests/browser/browser_resultSpan.js | 4 +- .../browser/browser_urlbar_event_telemetry.js | 2 +- .../test_UrlbarQueryContext_restrictSource.js | 7 -- .../unit/test_autofill_originsAndQueries.js | 74 +++++++++---------- .../unit/test_autofill_search_engines.js | 2 +- .../urlbar/tests/unit/test_autofill_urls.js | 4 +- .../tests/unit/test_avoid_middle_complete.js | 2 +- .../test_avoid_stripping_to_empty_tokens.js | 4 +- .../urlbar/tests/unit/test_casing.js | 8 +- .../tests/unit/test_heuristic_cancel.js | 2 +- ...fiedComplete.js => test_providerPlaces.js} | 10 +-- ... test_providerPlaces_duplicate_entries.js} | 0 .../tests/unit/test_providerTabToSearch.js | 4 +- .../urlbar/tests/unit/test_query_url.js | 10 +-- .../tests/unit/test_search_engine_host.js | 2 +- .../urlbar/tests/unit/test_special_search.js | 4 +- .../components/urlbar/tests/unit/xpcshell.ini | 4 +- 29 files changed, 93 insertions(+), 102 deletions(-) rename browser/components/urlbar/tests/unit/{test_providerUnifiedComplete.js => test_providerPlaces.js} (95%) rename browser/components/urlbar/tests/unit/{test_providerUnifiedComplete_duplicate_entries.js => test_providerPlaces_duplicate_entries.js} (100%) diff --git a/browser/components/extensions/test/xpcshell/test_ext_urlbar.js b/browser/components/extensions/test/xpcshell/test_ext_urlbar.js index 2a966437cbd6..cabd240f2ff0 100644 --- a/browser/components/extensions/test/xpcshell/test_ext_urlbar.js +++ b/browser/components/extensions/test/xpcshell/test_ext_urlbar.js @@ -865,7 +865,7 @@ add_task(async function test_heuristicRestricting() { // Adds a non-restricting provider that returns a heuristic result. The actual // result created from the extension's result should *not* be a heuristic, and -// the usual UnifiedComplete heuristic should be present. +// the usual UrlbarProviderHeuristicFallback heuristic should be present. add_task(async function test_heuristicNonRestricting() { let ext = ExtensionTestUtils.loadExtension({ manifest: { @@ -908,7 +908,8 @@ add_task(async function test_heuristicNonRestricting() { let controller = UrlbarTestUtils.newMockController(); await controller.startQuery(context); - // Check the results. The first result should be UnifiedComplete's heuristic. + // Check the results. The first result should be + // UrlbarProviderHeuristicFallback's heuristic. let firstResult = context.results[0]; Assert.ok(firstResult.heuristic); Assert.equal(firstResult.type, UrlbarUtils.RESULT_TYPE.SEARCH); diff --git a/browser/components/urlbar/UrlbarMuxerUnifiedComplete.jsm b/browser/components/urlbar/UrlbarMuxerUnifiedComplete.jsm index 1d53ca73cf89..ad5754f90de3 100644 --- a/browser/components/urlbar/UrlbarMuxerUnifiedComplete.jsm +++ b/browser/components/urlbar/UrlbarMuxerUnifiedComplete.jsm @@ -585,7 +585,7 @@ class MuxerUnifiedComplete extends UrlbarMuxer { * True if the result can be added and false if it should be discarded. */ _canAddResult(result, state) { - // We expect UnifiedComplete sent us the highest-ranked www. and non-www + // We expect UrlbarProviderPlaces sent us the highest-ranked www. and non-www // origins, if any. Now, compare them to each other and to the heuristic // result. // diff --git a/browser/components/urlbar/UrlbarPrefs.jsm b/browser/components/urlbar/UrlbarPrefs.jsm index 1812c479ce86..bccdde1de696 100644 --- a/browser/components/urlbar/UrlbarPrefs.jsm +++ b/browser/components/urlbar/UrlbarPrefs.jsm @@ -48,7 +48,7 @@ const PREF_URLBAR_DEFAULTS = new Map([ // Affects the frecency threshold of the autofill algorithm. The threshold is // the mean of all origin frecencies plus one standard deviation multiplied by - // this value. See UnifiedComplete. + // this value. See UrlbarProviderPlaces. ["autoFill.stddevMultiplier", [0.0, "float"]], // Whether using `ctrl` when hitting return/enter in the URL bar diff --git a/browser/components/urlbar/UrlbarProviderExtension.jsm b/browser/components/urlbar/UrlbarProviderExtension.jsm index 482d7e116e0a..d4a2c6b582fc 100644 --- a/browser/components/urlbar/UrlbarProviderExtension.jsm +++ b/browser/components/urlbar/UrlbarProviderExtension.jsm @@ -363,7 +363,7 @@ class UrlbarProviderExtension extends UrlbarProvider { if (extResult.heuristic && this.behavior == "restricting") { // The muxer chooses the final heuristic result by taking the first one // that claims to be the heuristic. We don't want extensions to clobber - // UnifiedComplete's heuristic, so we allow this only if the provider is + // the default heuristic, so we allow this only if the provider is // restricting. result.heuristic = extResult.heuristic; } diff --git a/browser/components/urlbar/UrlbarProviderOpenTabs.jsm b/browser/components/urlbar/UrlbarProviderOpenTabs.jsm index 39e3072343ff..d344c4974372 100644 --- a/browser/components/urlbar/UrlbarProviderOpenTabs.jsm +++ b/browser/components/urlbar/UrlbarProviderOpenTabs.jsm @@ -57,7 +57,7 @@ class UrlbarProviderOpenTabs extends UrlbarProvider { */ isActive(queryContext) { // For now we don't actually use this provider to query open tabs, instead - // we join the temp table in UnifiedComplete. + // we join the temp table in UrlbarProviderPlaces. return false; } diff --git a/browser/components/urlbar/UrlbarProviderPlaces.jsm b/browser/components/urlbar/UrlbarProviderPlaces.jsm index 05705af35cc7..dfe607fdf520 100644 --- a/browser/components/urlbar/UrlbarProviderPlaces.jsm +++ b/browser/components/urlbar/UrlbarProviderPlaces.jsm @@ -350,9 +350,9 @@ function makeUrlbarResult(tokens, info) { let tags = []; let comment = info.comment; - // UnifiedComplete may return "bookmark", "bookmark-tag" or "tag". In the last - // case it should not be considered a bookmark, but an history item with tags. - // We don't show tags for non bookmarked items though. + // The legacy autocomplete result may return "bookmark", "bookmark-tag" or + // "tag". In the last case it should not be considered a bookmark, but an + // history item with tags. We don't show tags for non bookmarked items though. if (info.style.includes("bookmark")) { source = UrlbarUtils.RESULT_SOURCE.BOOKMARKS; } else { @@ -1427,7 +1427,7 @@ class ProviderPlaces extends UrlbarProvider { let conn = await PlacesUtils.promiseLargeCacheDBConnection(); // We don't catch exceptions here as it is too late to block shutdown. - Sqlite.shutdown.addBlocker("Places UnifiedComplete.js closing", () => { + Sqlite.shutdown.addBlocker("UrlbarProviderPlaces closing", () => { // Break a possible cycle through the // previous result, the controller and // ourselves. diff --git a/browser/components/urlbar/UrlbarProviderSearchTips.jsm b/browser/components/urlbar/UrlbarProviderSearchTips.jsm index f43efec537fe..30a997de0be6 100644 --- a/browser/components/urlbar/UrlbarProviderSearchTips.jsm +++ b/browser/components/urlbar/UrlbarProviderSearchTips.jsm @@ -118,8 +118,7 @@ class ProviderSearchTips extends UrlbarProvider { } get PRIORITY() { - // Search tips are prioritized over the UnifiedComplete and top sites - // providers. + // Search tips are prioritized over the Places and top sites providers. return UrlbarProviderTopSites.PRIORITY + 1; } diff --git a/browser/components/urlbar/UrlbarProviderTokenAliasEngines.jsm b/browser/components/urlbar/UrlbarProviderTokenAliasEngines.jsm index 42e3adeb8648..bc96bee1ced2 100644 --- a/browser/components/urlbar/UrlbarProviderTokenAliasEngines.jsm +++ b/browser/components/urlbar/UrlbarProviderTokenAliasEngines.jsm @@ -48,7 +48,7 @@ class ProviderTokenAliasEngines extends UrlbarProvider { } get PRIORITY() { - // Beats UrlbarProviderSearchSuggestions and UnifiedComplete. + // Beats UrlbarProviderSearchSuggestions and UrlbarProviderPlaces. return 1; } @@ -177,8 +177,7 @@ class ProviderTokenAliasEngines extends UrlbarProvider { // We found the engine. // Stop adding an autofill result once the user has typed the full - // alias followed by a space. UrlbarProviderUnifiedComplete will take - // over at this point. + // alias followed by a space. We enter search mode at that point. if ( lowerCaseSearchString.startsWith(alias) && UrlbarTokenizer.REGEXP_SPACES_START.test( diff --git a/browser/components/urlbar/UrlbarProviderTopSites.jsm b/browser/components/urlbar/UrlbarProviderTopSites.jsm index c6b6ea2f62e3..ff2c1da76b57 100644 --- a/browser/components/urlbar/UrlbarProviderTopSites.jsm +++ b/browser/components/urlbar/UrlbarProviderTopSites.jsm @@ -43,7 +43,7 @@ class ProviderTopSites extends UrlbarProvider { } get PRIORITY() { - // Top sites are prioritized over the UnifiedComplete provider. + // Top sites are prioritized over the UrlbarProviderPlaces provider. return 1; } @@ -98,7 +98,7 @@ class ProviderTopSites extends UrlbarProvider { // If system.topsites is disabled, we would get stale or empty Top Sites // data. We check this condition here instead of in isActive because we // still want this provider to be restricting even if this is not true. If - // it wasn't restricting, we would show the results from UnifiedComplete's + // it wasn't restricting, we would show the results from UrlbarProviderPlaces's // empty search behaviour. We aren't interested in those since they are very // similar to Top Sites and thus might be confusing, especially since users // can configure Top Sites but cannot configure the default empty search diff --git a/browser/components/urlbar/UrlbarUtils.jsm b/browser/components/urlbar/UrlbarUtils.jsm index 676e5382823e..eeb676282d36 100644 --- a/browser/components/urlbar/UrlbarUtils.jsm +++ b/browser/components/urlbar/UrlbarUtils.jsm @@ -182,12 +182,11 @@ var UrlbarUtils = { SUGGESTED: 2, }, - // UnifiedComplete's autocomplete results store their titles and tags together - // in their comments. This separator is used to separate them. When we - // rewrite UnifiedComplete for quantumbar, we should stop using this old hack - // and store titles and tags separately. It's important that this be a - // character that no title would ever have. We use \x1F, the non-printable - // unit separator. + // UrlbarProviderPlaces's autocomplete results store their titles and tags + // together in their comments. This separator is used to separate them. + // After bug 1717511, we should stop using this old hack and store titles and + // tags separately. It's important that this be a character that no title + // would ever have. We use \x1F, the non-printable unit separator. TITLE_TAGS_SEPARATOR: "\x1F", // Regex matching single word hosts with an optional port; no spaces, auth or diff --git a/browser/components/urlbar/docs/index.rst b/browser/components/urlbar/docs/index.rst index 47a54ec1d4b6..c85ed2542d9f 100644 --- a/browser/components/urlbar/docs/index.rst +++ b/browser/components/urlbar/docs/index.rst @@ -25,9 +25,7 @@ If you are interested in the technical details, you might want to skip ahead to Codebase -------- -Most of the address bar code lives in `browser/components/urlbar `_. -A separate and important back-end piece currently is `toolkit/components/places/UnifiedComplete.jsm `_, which was carried over from awesomebar and is -undergoing refactoring for quantumbar. +The address bar code lives in `browser/components/urlbar `_. Table of Contents ----------------- diff --git a/browser/components/urlbar/docs/telemetry.rst b/browser/components/urlbar/docs/telemetry.rst index b1a6ce25a26c..b420583824de 100644 --- a/browser/components/urlbar/docs/telemetry.rst +++ b/browser/components/urlbar/docs/telemetry.rst @@ -353,8 +353,10 @@ Event Extra This is only present for ``engagement`` events. - ``provider`` The name of the result provider for the selected result. Existing values - are: ``HeuristicFallback``, ``Autofill``, ``UnifiedComplete``, + are: ``HeuristicFallback``, ``Autofill``, ``Places``, ``TokenAliasEngines``, ``SearchSuggestions``, ``UrlbarProviderTopSites``. + Data from before Firefox 91 will also list ``UnifiedComplete`` as a + provider. This is equivalent to ``Places``. Values can also be defined by `URLBar provider experiments`_. .. _URLBar provider experiments: experiments.html#developing-address-bar-extensions diff --git a/browser/components/urlbar/tests/browser/browser_resultSpan.js b/browser/components/urlbar/tests/browser/browser_resultSpan.js index 29f8a50d44c5..12940aa95f03 100644 --- a/browser/components/urlbar/tests/browser/browser_resultSpan.js +++ b/browser/components/urlbar/tests/browser/browser_resultSpan.js @@ -127,7 +127,7 @@ add_task(async function oneTip_nonRestricting() { let expectedResults = Array.from(results); - // UnifiedComplete's heuristic search result + // UrlbarProviderHeuristicFallback's heuristic search result expectedResults.unshift({ type: UrlbarUtils.RESULT_TYPE.SEARCH, source: UrlbarUtils.RESULT_SOURCE.SEARCH, @@ -182,7 +182,7 @@ add_task(async function threeTips_nonRestricting() { let expectedResults = Array.from(results); - // UnifiedComplete's heuristic search result + // UrlbarProviderHeuristicFallback's heuristic search result expectedResults.unshift({ type: UrlbarUtils.RESULT_TYPE.SEARCH, source: UrlbarUtils.RESULT_SOURCE.SEARCH, diff --git a/browser/components/urlbar/tests/browser/browser_urlbar_event_telemetry.js b/browser/components/urlbar/tests/browser/browser_urlbar_event_telemetry.js index 34dcfd446f03..397859e88313 100644 --- a/browser/components/urlbar/tests/browser/browser_urlbar_event_telemetry.js +++ b/browser/components/urlbar/tests/browser/browser_urlbar_event_telemetry.js @@ -360,7 +360,7 @@ const tests = [ numWords: "1", selIndex: val => parseInt(val) > 0, selType: "bookmark", - provider: "UnifiedComplete", + provider: "Places", }, }; }, diff --git a/browser/components/urlbar/tests/unit/test_UrlbarQueryContext_restrictSource.js b/browser/components/urlbar/tests/unit/test_UrlbarQueryContext_restrictSource.js index 42b866435a7b..ba02531605d0 100644 --- a/browser/components/urlbar/tests/unit/test_UrlbarQueryContext_restrictSource.js +++ b/browser/components/urlbar/tests/unit/test_UrlbarQueryContext_restrictSource.js @@ -15,13 +15,6 @@ add_task(async function setup() { ); }); -XPCOMUtils.defineLazyServiceGetter( - this, - "unifiedComplete", - "@mozilla.org/autocomplete/search;1?name=unifiedcomplete", - "nsIAutoCompleteSearch" -); - add_task(async function test_restrictions() { await PlacesTestUtils.addVisits([ { uri: "http://history.com/", title: "match" }, diff --git a/browser/components/urlbar/tests/unit/test_autofill_originsAndQueries.js b/browser/components/urlbar/tests/unit/test_autofill_originsAndQueries.js index ce90071bceda..35e6c1a46f09 100644 --- a/browser/components/urlbar/tests/unit/test_autofill_originsAndQueries.js +++ b/browser/components/urlbar/tests/unit/test_autofill_originsAndQueries.js @@ -3,7 +3,7 @@ * You can obtain one at http://mozilla.org/MPL/2.0/. */ const HEURISTIC_FALLBACK_PROVIDERNAME = "HeuristicFallback"; -const UNIFIEDCOMPLETE_PROVIDERNAME = "UnifiedComplete"; +const PLACES_PROVIDERNAME = "Places"; /** * Helpful reminder of the `autofilled` and `completed` properties in the @@ -333,7 +333,7 @@ add_autofill_task(async function httpPrefixShouldNotMatchHTTPS() { makeVisitResult(context, { uri: "https://" + url, title: "test visit for https://" + url, - providerName: UNIFIEDCOMPLETE_PROVIDERNAME, + providerName: PLACES_PROVIDERNAME, }), ], }); @@ -526,7 +526,7 @@ add_autofill_task(async function httpsPrefixShouldNotMatchHTTP() { makeVisitResult(context, { uri: "http://" + url, title: "test visit for http://" + url, - providerName: UNIFIEDCOMPLETE_PROVIDERNAME, + providerName: PLACES_PROVIDERNAME, }), ], }); @@ -627,7 +627,7 @@ add_autofill_task(async function frecency() { makeVisitResult(context, { uri: "https://" + url, title: "test visit for https://" + url, - providerName: UNIFIEDCOMPLETE_PROVIDERNAME, + providerName: PLACES_PROVIDERNAME, }), ], }); @@ -650,7 +650,7 @@ add_autofill_task(async function frecency() { makeVisitResult(context, { uri: "https://" + url, title: "test visit for https://" + url, - providerName: UNIFIEDCOMPLETE_PROVIDERNAME, + providerName: PLACES_PROVIDERNAME, }), ], }); @@ -673,7 +673,7 @@ add_autofill_task(async function frecency() { makeVisitResult(context, { uri: "https://" + url, title: "test visit for https://" + url, - providerName: UNIFIEDCOMPLETE_PROVIDERNAME, + providerName: PLACES_PROVIDERNAME, }), ], }); @@ -714,7 +714,7 @@ add_autofill_task(async function frecency() { makeVisitResult(context, { uri: "https://not-" + url, title: "test visit for https://not-" + url, - providerName: UNIFIEDCOMPLETE_PROVIDERNAME, + providerName: PLACES_PROVIDERNAME, }), ], }); @@ -726,8 +726,8 @@ add_autofill_task(async function frecency() { await PlacesTestUtils.addVisits([{ uri: "https://not-" + url }]); } - // In the `origins` case, the failure to make an autofill - // match means UnifiedComplete should not create a heuristic result. In the + // In the `origins` case, the failure to make an autofill match means + // HeuristicFallback should not create a heuristic result. In the // `!origins` case, autofill should still happen since there's no threshold // comparison. context = createContext(search, { isPrivate: false }); @@ -743,12 +743,12 @@ add_autofill_task(async function frecency() { makeVisitResult(context, { uri: "https://not-" + url, title: "test visit for https://not-" + url, - providerName: UNIFIEDCOMPLETE_PROVIDERNAME, + providerName: PLACES_PROVIDERNAME, }), makeVisitResult(context, { uri: "https://" + url, title: "test visit for https://" + url, - providerName: UNIFIEDCOMPLETE_PROVIDERNAME, + providerName: PLACES_PROVIDERNAME, }), ], }); @@ -766,7 +766,7 @@ add_autofill_task(async function frecency() { makeVisitResult(context, { uri: "https://not-" + url, title: "test visit for https://not-" + url, - providerName: UNIFIEDCOMPLETE_PROVIDERNAME, + providerName: PLACES_PROVIDERNAME, }), ], }); @@ -876,7 +876,7 @@ add_autofill_task(async function bookmarkBelowThreshold() { makeVisitResult(context, { uri: "http://not-" + url, title: "test visit for http://not-" + url, - providerName: UNIFIEDCOMPLETE_PROVIDERNAME, + providerName: PLACES_PROVIDERNAME, }), ], }); @@ -1412,7 +1412,7 @@ add_autofill_task(async function suggestBookmarkFalse_visit_1() { makeVisitResult(context, { uri: "http://non-matching-" + url, title: "test visit for http://non-matching-" + url, - providerName: UNIFIEDCOMPLETE_PROVIDERNAME, + providerName: PLACES_PROVIDERNAME, }), ]; if (origins) { @@ -1504,7 +1504,7 @@ add_autofill_task(async function suggestBookmarkFalse_visit_prefix_1() { makeVisitResult(context, { uri: "ftp://" + url, title: "test visit for ftp://" + url, - providerName: UNIFIEDCOMPLETE_PROVIDERNAME, + providerName: PLACES_PROVIDERNAME, }), ], }); @@ -1542,7 +1542,7 @@ add_autofill_task(async function suggestBookmarkFalse_visit_prefix_2() { makeVisitResult(context, { uri: "http://non-matching-" + url, title: "test visit for http://non-matching-" + url, - providerName: UNIFIEDCOMPLETE_PROVIDERNAME, + providerName: PLACES_PROVIDERNAME, }), ], }); @@ -1580,7 +1580,7 @@ add_autofill_task(async function suggestBookmarkFalse_visit_prefix_3() { makeVisitResult(context, { uri: "ftp://non-matching-" + url, title: "test visit for ftp://non-matching-" + url, - providerName: UNIFIEDCOMPLETE_PROVIDERNAME, + providerName: PLACES_PROVIDERNAME, }), ], }); @@ -2048,12 +2048,12 @@ add_autofill_task(async function suggestBookmarkFalse_visitedBookmarkBelow() { makeVisitResult(context, { uri: "http://some-other-" + url, title: "test visit for http://some-other-" + url, - providerName: UNIFIEDCOMPLETE_PROVIDERNAME, + providerName: PLACES_PROVIDERNAME, }), makeVisitResult(context, { uri: "http://" + url, title: "test visit for http://" + url, - providerName: UNIFIEDCOMPLETE_PROVIDERNAME, + providerName: PLACES_PROVIDERNAME, }), ], }); @@ -2074,12 +2074,12 @@ add_autofill_task(async function suggestBookmarkFalse_visitedBookmarkBelow() { makeVisitResult(context, { uri: "http://some-other-" + url, title: "test visit for http://some-other-" + url, - providerName: UNIFIEDCOMPLETE_PROVIDERNAME, + providerName: PLACES_PROVIDERNAME, }), makeVisitResult(context, { uri: "http://" + url, title: "A bookmark", - providerName: UNIFIEDCOMPLETE_PROVIDERNAME, + providerName: PLACES_PROVIDERNAME, }), ], }); @@ -2124,12 +2124,12 @@ add_autofill_task( makeVisitResult(context, { uri: "http://some-other-" + url, title: "test visit for http://some-other-" + url, - providerName: UNIFIEDCOMPLETE_PROVIDERNAME, + providerName: PLACES_PROVIDERNAME, }), makeVisitResult(context, { uri: "http://" + url, title: "test visit for http://" + url, - providerName: UNIFIEDCOMPLETE_PROVIDERNAME, + providerName: PLACES_PROVIDERNAME, }), ], }); @@ -2153,12 +2153,12 @@ add_autofill_task( makeVisitResult(context, { uri: "http://some-other-" + url, title: "test visit for http://some-other-" + url, - providerName: UNIFIEDCOMPLETE_PROVIDERNAME, + providerName: PLACES_PROVIDERNAME, }), makeVisitResult(context, { uri: "http://" + url, title: "A bookmark", - providerName: UNIFIEDCOMPLETE_PROVIDERNAME, + providerName: PLACES_PROVIDERNAME, }), ], }); @@ -2204,12 +2204,12 @@ add_autofill_task( makeVisitResult(context, { uri: "ftp://some-other-" + url, title: "test visit for ftp://some-other-" + url, - providerName: UNIFIEDCOMPLETE_PROVIDERNAME, + providerName: PLACES_PROVIDERNAME, }), makeVisitResult(context, { uri: "ftp://" + url, title: "test visit for ftp://" + url, - providerName: UNIFIEDCOMPLETE_PROVIDERNAME, + providerName: PLACES_PROVIDERNAME, }), ], }); @@ -2233,12 +2233,12 @@ add_autofill_task( makeVisitResult(context, { uri: "ftp://some-other-" + url, title: "test visit for ftp://some-other-" + url, - providerName: UNIFIEDCOMPLETE_PROVIDERNAME, + providerName: PLACES_PROVIDERNAME, }), makeVisitResult(context, { uri: "ftp://" + url, title: "A bookmark", - providerName: UNIFIEDCOMPLETE_PROVIDERNAME, + providerName: PLACES_PROVIDERNAME, }), ], }); @@ -2284,12 +2284,12 @@ add_autofill_task( makeVisitResult(context, { uri: "http://some-other-" + url, title: "test visit for http://some-other-" + url, - providerName: UNIFIEDCOMPLETE_PROVIDERNAME, + providerName: PLACES_PROVIDERNAME, }), makeVisitResult(context, { uri: "http://non-matching-" + url, title: "test visit for http://non-matching-" + url, - providerName: UNIFIEDCOMPLETE_PROVIDERNAME, + providerName: PLACES_PROVIDERNAME, }), ], }); @@ -2313,12 +2313,12 @@ add_autofill_task( makeVisitResult(context, { uri: "http://some-other-" + url, title: "test visit for http://some-other-" + url, - providerName: UNIFIEDCOMPLETE_PROVIDERNAME, + providerName: PLACES_PROVIDERNAME, }), makeVisitResult(context, { uri: "http://non-matching-" + url, title: "A bookmark", - providerName: UNIFIEDCOMPLETE_PROVIDERNAME, + providerName: PLACES_PROVIDERNAME, }), ], }); @@ -2364,12 +2364,12 @@ add_autofill_task( makeVisitResult(context, { uri: "ftp://some-other-" + url, title: "test visit for ftp://some-other-" + url, - providerName: UNIFIEDCOMPLETE_PROVIDERNAME, + providerName: PLACES_PROVIDERNAME, }), makeVisitResult(context, { uri: "ftp://non-matching-" + url, title: "test visit for ftp://non-matching-" + url, - providerName: UNIFIEDCOMPLETE_PROVIDERNAME, + providerName: PLACES_PROVIDERNAME, }), ], }); @@ -2393,12 +2393,12 @@ add_autofill_task( makeVisitResult(context, { uri: "ftp://some-other-" + url, title: "test visit for ftp://some-other-" + url, - providerName: UNIFIEDCOMPLETE_PROVIDERNAME, + providerName: PLACES_PROVIDERNAME, }), makeVisitResult(context, { uri: "ftp://non-matching-" + url, title: "A bookmark", - providerName: UNIFIEDCOMPLETE_PROVIDERNAME, + providerName: PLACES_PROVIDERNAME, }), ], }); diff --git a/browser/components/urlbar/tests/unit/test_autofill_search_engines.js b/browser/components/urlbar/tests/unit/test_autofill_search_engines.js index 61335a5cb015..7d6406a36c7e 100644 --- a/browser/components/urlbar/tests/unit/test_autofill_search_engines.js +++ b/browser/components/urlbar/tests/unit/test_autofill_search_engines.js @@ -4,7 +4,7 @@ // The autoFill.searchEngines pref autofills the domains of engines registered // with the search service. That's what this test checks. It's a different -// path in UnifiedComplete.js from normal moz_places autofill, which is tested +// path in ProviderAutofill from normal moz_places autofill, which is tested // in test_autofill_origins.js and test_autofill_urls.js. "use strict"; diff --git a/browser/components/urlbar/tests/unit/test_autofill_urls.js b/browser/components/urlbar/tests/unit/test_autofill_urls.js index 4ceef92b65c0..f14f1711fb74 100644 --- a/browser/components/urlbar/tests/unit/test_autofill_urls.js +++ b/browser/components/urlbar/tests/unit/test_autofill_urls.js @@ -5,7 +5,7 @@ "use strict"; const HEURISTIC_FALLBACK_PROVIDERNAME = "HeuristicFallback"; -const UNIFIEDCOMPLETE_PROVIDERNAME = "UnifiedComplete"; +const PLACES_PROVIDERNAME = "Places"; // "example.com/foo/" should match http://example.com/foo/. testEngine_setup(); @@ -101,7 +101,7 @@ add_task(async function port() { uri: "http://example.com:8888/foo/bar/baz", title: "test visit for http://example.com:8888/foo/bar/baz", tags: [], - providerName: UNIFIEDCOMPLETE_PROVIDERNAME, + providerName: PLACES_PROVIDERNAME, }), ], }); diff --git a/browser/components/urlbar/tests/unit/test_avoid_middle_complete.js b/browser/components/urlbar/tests/unit/test_avoid_middle_complete.js index f27e8763e8fb..62218c9068a8 100644 --- a/browser/components/urlbar/tests/unit/test_avoid_middle_complete.js +++ b/browser/components/urlbar/tests/unit/test_avoid_middle_complete.js @@ -261,7 +261,7 @@ add_task(async function test_prefix_autofill() { makeVisitResult(context, { uri: "http://mozilla.org/test/", title: "test visit for http://mozilla.org/test/", - providerName: "UnifiedComplete", + providerName: "Places", }), ], }); diff --git a/browser/components/urlbar/tests/unit/test_avoid_stripping_to_empty_tokens.js b/browser/components/urlbar/tests/unit/test_avoid_stripping_to_empty_tokens.js index 20bf75d834c1..bd01e0166bfc 100644 --- a/browser/components/urlbar/tests/unit/test_avoid_stripping_to_empty_tokens.js +++ b/browser/components/urlbar/tests/unit/test_avoid_stripping_to_empty_tokens.js @@ -78,7 +78,7 @@ add_task(async function test_protocol_trimming() { makeVisitResult(context, { uri: visit.uri.spec, title: visit.title, - providerName: "UnifiedComplete", + providerName: "Places", }), ], }); @@ -108,7 +108,7 @@ add_task(async function test_protocol_trimming() { makeVisitResult(context, { uri: visit.uri.spec, title: visit.title, - providerName: "UnifiedComplete", + providerName: "Places", }), ], }); diff --git a/browser/components/urlbar/tests/unit/test_casing.js b/browser/components/urlbar/tests/unit/test_casing.js index c49dce17fd5b..10fa87bb7b3f 100644 --- a/browser/components/urlbar/tests/unit/test_casing.js +++ b/browser/components/urlbar/tests/unit/test_casing.js @@ -4,7 +4,7 @@ const AUTOFILL_PROVIDERNAME = "Autofill"; const HEURISTIC_FALLBACK_PROVIDERNAME = "HeuristicFallback"; -const UNIFIEDCOMPLETE_PROVIDERNAME = "UnifiedComplete"; +const PLACES_PROVIDERNAME = "Places"; testEngine_setup(); @@ -27,7 +27,7 @@ add_task(async function test_casing_1() { makeVisitResult(context, { uri: "http://mozilla.org/test/", title: "test visit for http://mozilla.org/test/", - providerName: UNIFIEDCOMPLETE_PROVIDERNAME, + providerName: PLACES_PROVIDERNAME, }), ], }); @@ -143,7 +143,7 @@ add_task(async function test_untrimmed_casing() { makeVisitResult(context, { uri: "http://mozilla.org/Test/", title: "test visit for http://mozilla.org/Test/", - providerName: UNIFIEDCOMPLETE_PROVIDERNAME, + providerName: PLACES_PROVIDERNAME, }), ], }); @@ -169,7 +169,7 @@ add_task(async function test_untrimmed_www_casing() { makeVisitResult(context, { uri: "http://www.mozilla.org/Test/", title: "test visit for http://www.mozilla.org/Test/", - providerName: UNIFIEDCOMPLETE_PROVIDERNAME, + providerName: PLACES_PROVIDERNAME, }), ], }); diff --git a/browser/components/urlbar/tests/unit/test_heuristic_cancel.js b/browser/components/urlbar/tests/unit/test_heuristic_cancel.js index 44f7218a8c13..80f374b70d78 100644 --- a/browser/components/urlbar/tests/unit/test_heuristic_cancel.js +++ b/browser/components/urlbar/tests/unit/test_heuristic_cancel.js @@ -66,7 +66,7 @@ add_task(async function timerIsCancelled() { let context = createContext("m", { isPrivate: false }); await PlacesTestUtils.promiseAsyncUpdates(); info("Manually set up query and then overwrite it."); - // slowProvider is a stand-in for a slow UnifiedComplete returning a + // slowProvider is a stand-in for a slow UrlbarProviderPlaces returning a // non-heuristic result. let slowProvider = new SlowHeuristicProvider({ results: [ diff --git a/browser/components/urlbar/tests/unit/test_providerUnifiedComplete.js b/browser/components/urlbar/tests/unit/test_providerPlaces.js similarity index 95% rename from browser/components/urlbar/tests/unit/test_providerUnifiedComplete.js rename to browser/components/urlbar/tests/unit/test_providerPlaces.js index 115d4bb8e404..00dbe7dfbc6d 100644 --- a/browser/components/urlbar/tests/unit/test_providerUnifiedComplete.js +++ b/browser/components/urlbar/tests/unit/test_providerPlaces.js @@ -3,14 +3,14 @@ "use strict"; -// This is a simple test to check the UnifiedComplete provider works, it is not +// This is a simple test to check the Places provider works, it is not // intended to check all the edge cases, because that component is already // covered by a good amount of tests. const SUGGEST_PREF = "browser.urlbar.suggest.searches"; const SUGGEST_ENABLED_PREF = "browser.search.suggest.enabled"; -add_task(async function test_unifiedComplete() { +add_task(async function test_places() { Services.prefs.setBoolPref(SUGGEST_PREF, true); Services.prefs.setBoolPref(SUGGEST_ENABLED_PREF, true); let engine = await addTestSuggestionsEngine(); @@ -100,7 +100,7 @@ add_task(async function test_bookmarkBehaviorDisabled_tagged() { Services.prefs.setBoolPref(SUGGEST_PREF, false); Services.prefs.setBoolPref(SUGGEST_ENABLED_PREF, false); - // Disable the bookmark behavior in UnifiedComplete. + // Disable the bookmark behavior. Services.prefs.setBoolPref("browser.urlbar.suggest.bookmark", false); let controller = UrlbarTestUtils.newMockController(); @@ -154,7 +154,7 @@ add_task(async function test_bookmarkBehaviorDisabled_untagged() { Services.prefs.setBoolPref(SUGGEST_PREF, false); Services.prefs.setBoolPref(SUGGEST_ENABLED_PREF, false); - // Disable the bookmark behavior in UnifiedComplete. + // Disable the bookmark behavior. Services.prefs.setBoolPref("browser.urlbar.suggest.bookmark", false); let controller = UrlbarTestUtils.newMockController(); @@ -204,7 +204,7 @@ add_task(async function test_diacritics() { Services.prefs.setBoolPref(SUGGEST_PREF, false); Services.prefs.setBoolPref(SUGGEST_ENABLED_PREF, false); - // Enable the bookmark behavior in UnifiedComplete. + // Enable the bookmark behavior. Services.prefs.setBoolPref("browser.urlbar.suggest.bookmark", true); let controller = UrlbarTestUtils.newMockController(); diff --git a/browser/components/urlbar/tests/unit/test_providerUnifiedComplete_duplicate_entries.js b/browser/components/urlbar/tests/unit/test_providerPlaces_duplicate_entries.js similarity index 100% rename from browser/components/urlbar/tests/unit/test_providerUnifiedComplete_duplicate_entries.js rename to browser/components/urlbar/tests/unit/test_providerPlaces_duplicate_entries.js diff --git a/browser/components/urlbar/tests/unit/test_providerTabToSearch.js b/browser/components/urlbar/tests/unit/test_providerTabToSearch.js index e9d11e5b815d..3308f13c3897 100644 --- a/browser/components/urlbar/tests/unit/test_providerTabToSearch.js +++ b/browser/components/urlbar/tests/unit/test_providerTabToSearch.js @@ -282,7 +282,7 @@ add_task(async function conflictingEngines() { makeVisitResult(context, { uri: "https://foobar.com/", title: "test visit for https://foobar.com/", - providerName: "UnifiedComplete", + providerName: "Places", }), ], }); @@ -422,7 +422,7 @@ add_task(async function test_publicSuffix() { makeVisitResult(context, { uri: "https://test.mytest.it/", title: "test visit for https://test.mytest.it/", - providerName: "UnifiedComplete", + providerName: "Places", }), ], }); diff --git a/browser/components/urlbar/tests/unit/test_query_url.js b/browser/components/urlbar/tests/unit/test_query_url.js index 61026861e70e..02ecdaeb9517 100644 --- a/browser/components/urlbar/tests/unit/test_query_url.js +++ b/browser/components/urlbar/tests/unit/test_query_url.js @@ -3,7 +3,7 @@ * You can obtain one at http://mozilla.org/MPL/2.0/. */ const HEURISTIC_FALLBACK_PROVIDERNAME = "HeuristicFallback"; -const UNIFIEDCOMPLETE_PROVIDERNAME = "UnifiedComplete"; +const PLACES_PROVIDERNAME = "Places"; testEngine_setup(); @@ -28,12 +28,12 @@ add_task(async function test_no_slash() { uri: "file:///c:/test.html", title: "test visit for file:///c:/test.html", iconUri: UrlbarUtils.ICON.DEFAULT, - providerName: UNIFIEDCOMPLETE_PROVIDERNAME, + providerName: PLACES_PROVIDERNAME, }), makeVisitResult(context, { uri: "http://file.org/test/", title: "test visit for http://file.org/test/", - providerName: UNIFIEDCOMPLETE_PROVIDERNAME, + providerName: PLACES_PROVIDERNAME, }), ], }); @@ -64,7 +64,7 @@ add_task(async function test_w_slash() { makeVisitResult(context, { uri: "http://file.org/test/", title: "test visit for http://file.org/test/", - providerName: UNIFIEDCOMPLETE_PROVIDERNAME, + providerName: PLACES_PROVIDERNAME, }), ], }); @@ -114,7 +114,7 @@ add_task(async function test_nonhost() { uri: "file:///c:/test.html", title: "test visit for file:///c:/test.html", iconUri: UrlbarUtils.ICON.DEFAULT, - providerName: UNIFIEDCOMPLETE_PROVIDERNAME, + providerName: PLACES_PROVIDERNAME, }), ], }); diff --git a/browser/components/urlbar/tests/unit/test_search_engine_host.js b/browser/components/urlbar/tests/unit/test_search_engine_host.js index 53c348024cfd..2193a68ff736 100644 --- a/browser/components/urlbar/tests/unit/test_search_engine_host.js +++ b/browser/components/urlbar/tests/unit/test_search_engine_host.js @@ -84,7 +84,7 @@ add_task(async function test_searchEngine_noautoFill() { makeVisitResult(context, { uri: "http://my.search.com/samplepage/", title: "test visit for http://my.search.com/samplepage/", - providerName: "UnifiedComplete", + providerName: "Places", }), ], }); diff --git a/browser/components/urlbar/tests/unit/test_special_search.js b/browser/components/urlbar/tests/unit/test_special_search.js index ff5761cc13f9..7554433ba5b8 100644 --- a/browser/components/urlbar/tests/unit/test_special_search.js +++ b/browser/components/urlbar/tests/unit/test_special_search.js @@ -454,10 +454,10 @@ add_task(async function test_special_searches() { setSuggestPrefsToFalse(); Services.prefs.setBoolPref("browser.urlbar.suggest.history", true); Services.prefs.setBoolPref("browser.urlbar.suggest.bookmark", true); - // The purpose of this test is to verify what is being sent by UnifiedComplete. + // The purpose of this test is to verify what is being sent by ProviderPlaces. // It will send 10 results, but the heuristic result pushes the last result // out of the panel. We set maxRichResults to a high value to test the full - // output of UnifiedComplete. + // output of ProviderPlaces. Services.prefs.setIntPref("browser.urlbar.maxRichResults", 20); context = createContext("foo", { isPrivate: false }); await check_results({ diff --git a/browser/components/urlbar/tests/unit/xpcshell.ini b/browser/components/urlbar/tests/unit/xpcshell.ini index 01fb5f94b806..c383a2b8f81c 100644 --- a/browser/components/urlbar/tests/unit/xpcshell.ini +++ b/browser/components/urlbar/tests/unit/xpcshell.ini @@ -40,6 +40,8 @@ skip-if = os == 'linux' # bug 1474616 [test_providerKeywords.js] [test_providerOmnibox.js] [test_providerOpenTabs.js] +[test_providerPlaces.js] +[test_providerPlaces_duplicate_entries.js] [test_providerPlaces_nonEnglish.js] [test_providerPreloaded.js] [test_providersManager.js] @@ -47,8 +49,6 @@ skip-if = os == 'linux' # bug 1474616 [test_providersManager_maxResults.js] [test_providerTabToSearch.js] [test_providerTabToSearch_partialHost.js] -[test_providerUnifiedComplete.js] -[test_providerUnifiedComplete_duplicate_entries.js] [test_query_url.js] [test_queryScorer.js] [test_remote_tabs.js]