Bug 1717509 - Part 5 - Replace references to UnifiedComplete with references to UrlbarProviderPlaces. r=adw

Differential Revision: https://phabricator.services.mozilla.com/D119310
This commit is contained in:
Harry Twyford 2021-07-09 23:52:39 +00:00
Родитель aca42929d0
Коммит 8ee5ae1678
29 изменённых файлов: 93 добавлений и 102 удалений

Просмотреть файл

@ -865,7 +865,7 @@ add_task(async function test_heuristicRestricting() {
// Adds a non-restricting provider that returns a heuristic result. The actual // 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 // 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() { add_task(async function test_heuristicNonRestricting() {
let ext = ExtensionTestUtils.loadExtension({ let ext = ExtensionTestUtils.loadExtension({
manifest: { manifest: {
@ -908,7 +908,8 @@ add_task(async function test_heuristicNonRestricting() {
let controller = UrlbarTestUtils.newMockController(); let controller = UrlbarTestUtils.newMockController();
await controller.startQuery(context); 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]; let firstResult = context.results[0];
Assert.ok(firstResult.heuristic); Assert.ok(firstResult.heuristic);
Assert.equal(firstResult.type, UrlbarUtils.RESULT_TYPE.SEARCH); Assert.equal(firstResult.type, UrlbarUtils.RESULT_TYPE.SEARCH);

Просмотреть файл

@ -585,7 +585,7 @@ class MuxerUnifiedComplete extends UrlbarMuxer {
* True if the result can be added and false if it should be discarded. * True if the result can be added and false if it should be discarded.
*/ */
_canAddResult(result, state) { _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 // origins, if any. Now, compare them to each other and to the heuristic
// result. // result.
// //

Просмотреть файл

@ -48,7 +48,7 @@ const PREF_URLBAR_DEFAULTS = new Map([
// Affects the frecency threshold of the autofill algorithm. The threshold is // Affects the frecency threshold of the autofill algorithm. The threshold is
// the mean of all origin frecencies plus one standard deviation multiplied by // 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"]], ["autoFill.stddevMultiplier", [0.0, "float"]],
// Whether using `ctrl` when hitting return/enter in the URL bar // Whether using `ctrl` when hitting return/enter in the URL bar

Просмотреть файл

@ -363,7 +363,7 @@ class UrlbarProviderExtension extends UrlbarProvider {
if (extResult.heuristic && this.behavior == "restricting") { if (extResult.heuristic && this.behavior == "restricting") {
// The muxer chooses the final heuristic result by taking the first one // 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 // 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. // restricting.
result.heuristic = extResult.heuristic; result.heuristic = extResult.heuristic;
} }

Просмотреть файл

@ -57,7 +57,7 @@ class UrlbarProviderOpenTabs extends UrlbarProvider {
*/ */
isActive(queryContext) { isActive(queryContext) {
// For now we don't actually use this provider to query open tabs, instead // 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; return false;
} }

Просмотреть файл

@ -350,9 +350,9 @@ function makeUrlbarResult(tokens, info) {
let tags = []; let tags = [];
let comment = info.comment; let comment = info.comment;
// UnifiedComplete may return "bookmark", "bookmark-tag" or "tag". In the last // The legacy autocomplete result may return "bookmark", "bookmark-tag" or
// case it should not be considered a bookmark, but an history item with tags. // "tag". In the last case it should not be considered a bookmark, but an
// We don't show tags for non bookmarked items though. // history item with tags. We don't show tags for non bookmarked items though.
if (info.style.includes("bookmark")) { if (info.style.includes("bookmark")) {
source = UrlbarUtils.RESULT_SOURCE.BOOKMARKS; source = UrlbarUtils.RESULT_SOURCE.BOOKMARKS;
} else { } else {
@ -1427,7 +1427,7 @@ class ProviderPlaces extends UrlbarProvider {
let conn = await PlacesUtils.promiseLargeCacheDBConnection(); let conn = await PlacesUtils.promiseLargeCacheDBConnection();
// We don't catch exceptions here as it is too late to block shutdown. // 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 // Break a possible cycle through the
// previous result, the controller and // previous result, the controller and
// ourselves. // ourselves.

Просмотреть файл

@ -118,8 +118,7 @@ class ProviderSearchTips extends UrlbarProvider {
} }
get PRIORITY() { get PRIORITY() {
// Search tips are prioritized over the UnifiedComplete and top sites // Search tips are prioritized over the Places and top sites providers.
// providers.
return UrlbarProviderTopSites.PRIORITY + 1; return UrlbarProviderTopSites.PRIORITY + 1;
} }

Просмотреть файл

@ -48,7 +48,7 @@ class ProviderTokenAliasEngines extends UrlbarProvider {
} }
get PRIORITY() { get PRIORITY() {
// Beats UrlbarProviderSearchSuggestions and UnifiedComplete. // Beats UrlbarProviderSearchSuggestions and UrlbarProviderPlaces.
return 1; return 1;
} }
@ -177,8 +177,7 @@ class ProviderTokenAliasEngines extends UrlbarProvider {
// We found the engine. // We found the engine.
// Stop adding an autofill result once the user has typed the full // Stop adding an autofill result once the user has typed the full
// alias followed by a space. UrlbarProviderUnifiedComplete will take // alias followed by a space. We enter search mode at that point.
// over at this point.
if ( if (
lowerCaseSearchString.startsWith(alias) && lowerCaseSearchString.startsWith(alias) &&
UrlbarTokenizer.REGEXP_SPACES_START.test( UrlbarTokenizer.REGEXP_SPACES_START.test(

Просмотреть файл

@ -43,7 +43,7 @@ class ProviderTopSites extends UrlbarProvider {
} }
get PRIORITY() { get PRIORITY() {
// Top sites are prioritized over the UnifiedComplete provider. // Top sites are prioritized over the UrlbarProviderPlaces provider.
return 1; return 1;
} }
@ -98,7 +98,7 @@ class ProviderTopSites extends UrlbarProvider {
// If system.topsites is disabled, we would get stale or empty Top Sites // 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 // 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 // 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 // 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 // similar to Top Sites and thus might be confusing, especially since users
// can configure Top Sites but cannot configure the default empty search // can configure Top Sites but cannot configure the default empty search

Просмотреть файл

@ -182,12 +182,11 @@ var UrlbarUtils = {
SUGGESTED: 2, SUGGESTED: 2,
}, },
// UnifiedComplete's autocomplete results store their titles and tags together // UrlbarProviderPlaces's autocomplete results store their titles and tags
// in their comments. This separator is used to separate them. When we // together in their comments. This separator is used to separate them.
// rewrite UnifiedComplete for quantumbar, we should stop using this old hack // After bug 1717511, we should stop using this old hack and store titles and
// and store titles and tags separately. It's important that this be a // tags separately. It's important that this be a character that no title
// character that no title would ever have. We use \x1F, the non-printable // would ever have. We use \x1F, the non-printable unit separator.
// unit separator.
TITLE_TAGS_SEPARATOR: "\x1F", TITLE_TAGS_SEPARATOR: "\x1F",
// Regex matching single word hosts with an optional port; no spaces, auth or // Regex matching single word hosts with an optional port; no spaces, auth or

Просмотреть файл

@ -25,9 +25,7 @@ If you are interested in the technical details, you might want to skip ahead to
Codebase Codebase
-------- --------
Most of the address bar code lives in `browser/components/urlbar <https://searchfox.org/mozilla-central/source/browser/components/urlbar/>`_. The address bar code lives in `browser/components/urlbar <https://searchfox.org/mozilla-central/source/browser/components/urlbar/>`_.
A separate and important back-end piece currently is `toolkit/components/places/UnifiedComplete.jsm <https://searchfox.org/mozilla-central/source/toolkit/components/places/UnifiedComplete.jsm>`_, which was carried over from awesomebar and is
undergoing refactoring for quantumbar.
Table of Contents Table of Contents
----------------- -----------------

Просмотреть файл

@ -353,8 +353,10 @@ Event Extra
This is only present for ``engagement`` events. This is only present for ``engagement`` events.
- ``provider`` - ``provider``
The name of the result provider for the selected result. Existing values The name of the result provider for the selected result. Existing values
are: ``HeuristicFallback``, ``Autofill``, ``UnifiedComplete``, are: ``HeuristicFallback``, ``Autofill``, ``Places``,
``TokenAliasEngines``, ``SearchSuggestions``, ``UrlbarProviderTopSites``. ``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`_. Values can also be defined by `URLBar provider experiments`_.
.. _URLBar provider experiments: experiments.html#developing-address-bar-extensions .. _URLBar provider experiments: experiments.html#developing-address-bar-extensions

Просмотреть файл

@ -127,7 +127,7 @@ add_task(async function oneTip_nonRestricting() {
let expectedResults = Array.from(results); let expectedResults = Array.from(results);
// UnifiedComplete's heuristic search result // UrlbarProviderHeuristicFallback's heuristic search result
expectedResults.unshift({ expectedResults.unshift({
type: UrlbarUtils.RESULT_TYPE.SEARCH, type: UrlbarUtils.RESULT_TYPE.SEARCH,
source: UrlbarUtils.RESULT_SOURCE.SEARCH, source: UrlbarUtils.RESULT_SOURCE.SEARCH,
@ -182,7 +182,7 @@ add_task(async function threeTips_nonRestricting() {
let expectedResults = Array.from(results); let expectedResults = Array.from(results);
// UnifiedComplete's heuristic search result // UrlbarProviderHeuristicFallback's heuristic search result
expectedResults.unshift({ expectedResults.unshift({
type: UrlbarUtils.RESULT_TYPE.SEARCH, type: UrlbarUtils.RESULT_TYPE.SEARCH,
source: UrlbarUtils.RESULT_SOURCE.SEARCH, source: UrlbarUtils.RESULT_SOURCE.SEARCH,

Просмотреть файл

@ -360,7 +360,7 @@ const tests = [
numWords: "1", numWords: "1",
selIndex: val => parseInt(val) > 0, selIndex: val => parseInt(val) > 0,
selType: "bookmark", selType: "bookmark",
provider: "UnifiedComplete", provider: "Places",
}, },
}; };
}, },

Просмотреть файл

@ -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() { add_task(async function test_restrictions() {
await PlacesTestUtils.addVisits([ await PlacesTestUtils.addVisits([
{ uri: "http://history.com/", title: "match" }, { uri: "http://history.com/", title: "match" },

Просмотреть файл

@ -3,7 +3,7 @@
* You can obtain one at http://mozilla.org/MPL/2.0/. */ * You can obtain one at http://mozilla.org/MPL/2.0/. */
const HEURISTIC_FALLBACK_PROVIDERNAME = "HeuristicFallback"; const HEURISTIC_FALLBACK_PROVIDERNAME = "HeuristicFallback";
const UNIFIEDCOMPLETE_PROVIDERNAME = "UnifiedComplete"; const PLACES_PROVIDERNAME = "Places";
/** /**
* Helpful reminder of the `autofilled` and `completed` properties in the * Helpful reminder of the `autofilled` and `completed` properties in the
@ -333,7 +333,7 @@ add_autofill_task(async function httpPrefixShouldNotMatchHTTPS() {
makeVisitResult(context, { makeVisitResult(context, {
uri: "https://" + url, uri: "https://" + url,
title: "test visit for 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, { makeVisitResult(context, {
uri: "http://" + url, uri: "http://" + url,
title: "test visit for 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, { makeVisitResult(context, {
uri: "https://" + url, uri: "https://" + url,
title: "test visit for 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, { makeVisitResult(context, {
uri: "https://" + url, uri: "https://" + url,
title: "test visit for 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, { makeVisitResult(context, {
uri: "https://" + url, uri: "https://" + url,
title: "test visit for 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, { makeVisitResult(context, {
uri: "https://not-" + url, uri: "https://not-" + url,
title: "test visit for 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 }]); await PlacesTestUtils.addVisits([{ uri: "https://not-" + url }]);
} }
// In the `origins` case, the failure to make an autofill // In the `origins` case, the failure to make an autofill match means
// match means UnifiedComplete should not create a heuristic result. In the // HeuristicFallback should not create a heuristic result. In the
// `!origins` case, autofill should still happen since there's no threshold // `!origins` case, autofill should still happen since there's no threshold
// comparison. // comparison.
context = createContext(search, { isPrivate: false }); context = createContext(search, { isPrivate: false });
@ -743,12 +743,12 @@ add_autofill_task(async function frecency() {
makeVisitResult(context, { makeVisitResult(context, {
uri: "https://not-" + url, uri: "https://not-" + url,
title: "test visit for https://not-" + url, title: "test visit for https://not-" + url,
providerName: UNIFIEDCOMPLETE_PROVIDERNAME, providerName: PLACES_PROVIDERNAME,
}), }),
makeVisitResult(context, { makeVisitResult(context, {
uri: "https://" + url, uri: "https://" + url,
title: "test visit for 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, { makeVisitResult(context, {
uri: "https://not-" + url, uri: "https://not-" + url,
title: "test visit for 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, { makeVisitResult(context, {
uri: "http://not-" + url, uri: "http://not-" + url,
title: "test visit for 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, { makeVisitResult(context, {
uri: "http://non-matching-" + url, uri: "http://non-matching-" + url,
title: "test visit for http://non-matching-" + url, title: "test visit for http://non-matching-" + url,
providerName: UNIFIEDCOMPLETE_PROVIDERNAME, providerName: PLACES_PROVIDERNAME,
}), }),
]; ];
if (origins) { if (origins) {
@ -1504,7 +1504,7 @@ add_autofill_task(async function suggestBookmarkFalse_visit_prefix_1() {
makeVisitResult(context, { makeVisitResult(context, {
uri: "ftp://" + url, uri: "ftp://" + url,
title: "test visit for 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, { makeVisitResult(context, {
uri: "http://non-matching-" + url, uri: "http://non-matching-" + url,
title: "test visit for 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, { makeVisitResult(context, {
uri: "ftp://non-matching-" + url, uri: "ftp://non-matching-" + url,
title: "test visit for 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, { makeVisitResult(context, {
uri: "http://some-other-" + url, uri: "http://some-other-" + url,
title: "test visit for http://some-other-" + url, title: "test visit for http://some-other-" + url,
providerName: UNIFIEDCOMPLETE_PROVIDERNAME, providerName: PLACES_PROVIDERNAME,
}), }),
makeVisitResult(context, { makeVisitResult(context, {
uri: "http://" + url, uri: "http://" + url,
title: "test visit for 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, { makeVisitResult(context, {
uri: "http://some-other-" + url, uri: "http://some-other-" + url,
title: "test visit for http://some-other-" + url, title: "test visit for http://some-other-" + url,
providerName: UNIFIEDCOMPLETE_PROVIDERNAME, providerName: PLACES_PROVIDERNAME,
}), }),
makeVisitResult(context, { makeVisitResult(context, {
uri: "http://" + url, uri: "http://" + url,
title: "A bookmark", title: "A bookmark",
providerName: UNIFIEDCOMPLETE_PROVIDERNAME, providerName: PLACES_PROVIDERNAME,
}), }),
], ],
}); });
@ -2124,12 +2124,12 @@ add_autofill_task(
makeVisitResult(context, { makeVisitResult(context, {
uri: "http://some-other-" + url, uri: "http://some-other-" + url,
title: "test visit for http://some-other-" + url, title: "test visit for http://some-other-" + url,
providerName: UNIFIEDCOMPLETE_PROVIDERNAME, providerName: PLACES_PROVIDERNAME,
}), }),
makeVisitResult(context, { makeVisitResult(context, {
uri: "http://" + url, uri: "http://" + url,
title: "test visit for http://" + url, title: "test visit for http://" + url,
providerName: UNIFIEDCOMPLETE_PROVIDERNAME, providerName: PLACES_PROVIDERNAME,
}), }),
], ],
}); });
@ -2153,12 +2153,12 @@ add_autofill_task(
makeVisitResult(context, { makeVisitResult(context, {
uri: "http://some-other-" + url, uri: "http://some-other-" + url,
title: "test visit for http://some-other-" + url, title: "test visit for http://some-other-" + url,
providerName: UNIFIEDCOMPLETE_PROVIDERNAME, providerName: PLACES_PROVIDERNAME,
}), }),
makeVisitResult(context, { makeVisitResult(context, {
uri: "http://" + url, uri: "http://" + url,
title: "A bookmark", title: "A bookmark",
providerName: UNIFIEDCOMPLETE_PROVIDERNAME, providerName: PLACES_PROVIDERNAME,
}), }),
], ],
}); });
@ -2204,12 +2204,12 @@ add_autofill_task(
makeVisitResult(context, { makeVisitResult(context, {
uri: "ftp://some-other-" + url, uri: "ftp://some-other-" + url,
title: "test visit for ftp://some-other-" + url, title: "test visit for ftp://some-other-" + url,
providerName: UNIFIEDCOMPLETE_PROVIDERNAME, providerName: PLACES_PROVIDERNAME,
}), }),
makeVisitResult(context, { makeVisitResult(context, {
uri: "ftp://" + url, uri: "ftp://" + url,
title: "test visit for ftp://" + url, title: "test visit for ftp://" + url,
providerName: UNIFIEDCOMPLETE_PROVIDERNAME, providerName: PLACES_PROVIDERNAME,
}), }),
], ],
}); });
@ -2233,12 +2233,12 @@ add_autofill_task(
makeVisitResult(context, { makeVisitResult(context, {
uri: "ftp://some-other-" + url, uri: "ftp://some-other-" + url,
title: "test visit for ftp://some-other-" + url, title: "test visit for ftp://some-other-" + url,
providerName: UNIFIEDCOMPLETE_PROVIDERNAME, providerName: PLACES_PROVIDERNAME,
}), }),
makeVisitResult(context, { makeVisitResult(context, {
uri: "ftp://" + url, uri: "ftp://" + url,
title: "A bookmark", title: "A bookmark",
providerName: UNIFIEDCOMPLETE_PROVIDERNAME, providerName: PLACES_PROVIDERNAME,
}), }),
], ],
}); });
@ -2284,12 +2284,12 @@ add_autofill_task(
makeVisitResult(context, { makeVisitResult(context, {
uri: "http://some-other-" + url, uri: "http://some-other-" + url,
title: "test visit for http://some-other-" + url, title: "test visit for http://some-other-" + url,
providerName: UNIFIEDCOMPLETE_PROVIDERNAME, providerName: PLACES_PROVIDERNAME,
}), }),
makeVisitResult(context, { makeVisitResult(context, {
uri: "http://non-matching-" + url, uri: "http://non-matching-" + url,
title: "test visit for 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, { makeVisitResult(context, {
uri: "http://some-other-" + url, uri: "http://some-other-" + url,
title: "test visit for http://some-other-" + url, title: "test visit for http://some-other-" + url,
providerName: UNIFIEDCOMPLETE_PROVIDERNAME, providerName: PLACES_PROVIDERNAME,
}), }),
makeVisitResult(context, { makeVisitResult(context, {
uri: "http://non-matching-" + url, uri: "http://non-matching-" + url,
title: "A bookmark", title: "A bookmark",
providerName: UNIFIEDCOMPLETE_PROVIDERNAME, providerName: PLACES_PROVIDERNAME,
}), }),
], ],
}); });
@ -2364,12 +2364,12 @@ add_autofill_task(
makeVisitResult(context, { makeVisitResult(context, {
uri: "ftp://some-other-" + url, uri: "ftp://some-other-" + url,
title: "test visit for ftp://some-other-" + url, title: "test visit for ftp://some-other-" + url,
providerName: UNIFIEDCOMPLETE_PROVIDERNAME, providerName: PLACES_PROVIDERNAME,
}), }),
makeVisitResult(context, { makeVisitResult(context, {
uri: "ftp://non-matching-" + url, uri: "ftp://non-matching-" + url,
title: "test visit for 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, { makeVisitResult(context, {
uri: "ftp://some-other-" + url, uri: "ftp://some-other-" + url,
title: "test visit for ftp://some-other-" + url, title: "test visit for ftp://some-other-" + url,
providerName: UNIFIEDCOMPLETE_PROVIDERNAME, providerName: PLACES_PROVIDERNAME,
}), }),
makeVisitResult(context, { makeVisitResult(context, {
uri: "ftp://non-matching-" + url, uri: "ftp://non-matching-" + url,
title: "A bookmark", title: "A bookmark",
providerName: UNIFIEDCOMPLETE_PROVIDERNAME, providerName: PLACES_PROVIDERNAME,
}), }),
], ],
}); });

Просмотреть файл

@ -4,7 +4,7 @@
// The autoFill.searchEngines pref autofills the domains of engines registered // The autoFill.searchEngines pref autofills the domains of engines registered
// with the search service. That's what this test checks. It's a different // 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. // in test_autofill_origins.js and test_autofill_urls.js.
"use strict"; "use strict";

Просмотреть файл

@ -5,7 +5,7 @@
"use strict"; "use strict";
const HEURISTIC_FALLBACK_PROVIDERNAME = "HeuristicFallback"; const HEURISTIC_FALLBACK_PROVIDERNAME = "HeuristicFallback";
const UNIFIEDCOMPLETE_PROVIDERNAME = "UnifiedComplete"; const PLACES_PROVIDERNAME = "Places";
// "example.com/foo/" should match http://example.com/foo/. // "example.com/foo/" should match http://example.com/foo/.
testEngine_setup(); testEngine_setup();
@ -101,7 +101,7 @@ add_task(async function port() {
uri: "http://example.com:8888/foo/bar/baz", uri: "http://example.com:8888/foo/bar/baz",
title: "test visit for http://example.com:8888/foo/bar/baz", title: "test visit for http://example.com:8888/foo/bar/baz",
tags: [], tags: [],
providerName: UNIFIEDCOMPLETE_PROVIDERNAME, providerName: PLACES_PROVIDERNAME,
}), }),
], ],
}); });

Просмотреть файл

@ -261,7 +261,7 @@ add_task(async function test_prefix_autofill() {
makeVisitResult(context, { makeVisitResult(context, {
uri: "http://mozilla.org/test/", uri: "http://mozilla.org/test/",
title: "test visit for http://mozilla.org/test/", title: "test visit for http://mozilla.org/test/",
providerName: "UnifiedComplete", providerName: "Places",
}), }),
], ],
}); });

Просмотреть файл

@ -78,7 +78,7 @@ add_task(async function test_protocol_trimming() {
makeVisitResult(context, { makeVisitResult(context, {
uri: visit.uri.spec, uri: visit.uri.spec,
title: visit.title, title: visit.title,
providerName: "UnifiedComplete", providerName: "Places",
}), }),
], ],
}); });
@ -108,7 +108,7 @@ add_task(async function test_protocol_trimming() {
makeVisitResult(context, { makeVisitResult(context, {
uri: visit.uri.spec, uri: visit.uri.spec,
title: visit.title, title: visit.title,
providerName: "UnifiedComplete", providerName: "Places",
}), }),
], ],
}); });

Просмотреть файл

@ -4,7 +4,7 @@
const AUTOFILL_PROVIDERNAME = "Autofill"; const AUTOFILL_PROVIDERNAME = "Autofill";
const HEURISTIC_FALLBACK_PROVIDERNAME = "HeuristicFallback"; const HEURISTIC_FALLBACK_PROVIDERNAME = "HeuristicFallback";
const UNIFIEDCOMPLETE_PROVIDERNAME = "UnifiedComplete"; const PLACES_PROVIDERNAME = "Places";
testEngine_setup(); testEngine_setup();
@ -27,7 +27,7 @@ add_task(async function test_casing_1() {
makeVisitResult(context, { makeVisitResult(context, {
uri: "http://mozilla.org/test/", uri: "http://mozilla.org/test/",
title: "test visit for 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, { makeVisitResult(context, {
uri: "http://mozilla.org/Test/", uri: "http://mozilla.org/Test/",
title: "test visit for 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, { makeVisitResult(context, {
uri: "http://www.mozilla.org/Test/", uri: "http://www.mozilla.org/Test/",
title: "test visit for http://www.mozilla.org/Test/", title: "test visit for http://www.mozilla.org/Test/",
providerName: UNIFIEDCOMPLETE_PROVIDERNAME, providerName: PLACES_PROVIDERNAME,
}), }),
], ],
}); });

Просмотреть файл

@ -66,7 +66,7 @@ add_task(async function timerIsCancelled() {
let context = createContext("m", { isPrivate: false }); let context = createContext("m", { isPrivate: false });
await PlacesTestUtils.promiseAsyncUpdates(); await PlacesTestUtils.promiseAsyncUpdates();
info("Manually set up query and then overwrite it."); 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. // non-heuristic result.
let slowProvider = new SlowHeuristicProvider({ let slowProvider = new SlowHeuristicProvider({
results: [ results: [

Просмотреть файл

@ -3,14 +3,14 @@
"use strict"; "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 // intended to check all the edge cases, because that component is already
// covered by a good amount of tests. // covered by a good amount of tests.
const SUGGEST_PREF = "browser.urlbar.suggest.searches"; const SUGGEST_PREF = "browser.urlbar.suggest.searches";
const SUGGEST_ENABLED_PREF = "browser.search.suggest.enabled"; 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_PREF, true);
Services.prefs.setBoolPref(SUGGEST_ENABLED_PREF, true); Services.prefs.setBoolPref(SUGGEST_ENABLED_PREF, true);
let engine = await addTestSuggestionsEngine(); 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_PREF, false);
Services.prefs.setBoolPref(SUGGEST_ENABLED_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); Services.prefs.setBoolPref("browser.urlbar.suggest.bookmark", false);
let controller = UrlbarTestUtils.newMockController(); 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_PREF, false);
Services.prefs.setBoolPref(SUGGEST_ENABLED_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); Services.prefs.setBoolPref("browser.urlbar.suggest.bookmark", false);
let controller = UrlbarTestUtils.newMockController(); let controller = UrlbarTestUtils.newMockController();
@ -204,7 +204,7 @@ add_task(async function test_diacritics() {
Services.prefs.setBoolPref(SUGGEST_PREF, false); Services.prefs.setBoolPref(SUGGEST_PREF, false);
Services.prefs.setBoolPref(SUGGEST_ENABLED_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); Services.prefs.setBoolPref("browser.urlbar.suggest.bookmark", true);
let controller = UrlbarTestUtils.newMockController(); let controller = UrlbarTestUtils.newMockController();

Просмотреть файл

@ -282,7 +282,7 @@ add_task(async function conflictingEngines() {
makeVisitResult(context, { makeVisitResult(context, {
uri: "https://foobar.com/", uri: "https://foobar.com/",
title: "test visit for 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, { makeVisitResult(context, {
uri: "https://test.mytest.it/", uri: "https://test.mytest.it/",
title: "test visit for https://test.mytest.it/", title: "test visit for https://test.mytest.it/",
providerName: "UnifiedComplete", providerName: "Places",
}), }),
], ],
}); });

Просмотреть файл

@ -3,7 +3,7 @@
* You can obtain one at http://mozilla.org/MPL/2.0/. */ * You can obtain one at http://mozilla.org/MPL/2.0/. */
const HEURISTIC_FALLBACK_PROVIDERNAME = "HeuristicFallback"; const HEURISTIC_FALLBACK_PROVIDERNAME = "HeuristicFallback";
const UNIFIEDCOMPLETE_PROVIDERNAME = "UnifiedComplete"; const PLACES_PROVIDERNAME = "Places";
testEngine_setup(); testEngine_setup();
@ -28,12 +28,12 @@ add_task(async function test_no_slash() {
uri: "file:///c:/test.html", uri: "file:///c:/test.html",
title: "test visit for file:///c:/test.html", title: "test visit for file:///c:/test.html",
iconUri: UrlbarUtils.ICON.DEFAULT, iconUri: UrlbarUtils.ICON.DEFAULT,
providerName: UNIFIEDCOMPLETE_PROVIDERNAME, providerName: PLACES_PROVIDERNAME,
}), }),
makeVisitResult(context, { makeVisitResult(context, {
uri: "http://file.org/test/", uri: "http://file.org/test/",
title: "test visit for 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, { makeVisitResult(context, {
uri: "http://file.org/test/", uri: "http://file.org/test/",
title: "test visit for 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", uri: "file:///c:/test.html",
title: "test visit for file:///c:/test.html", title: "test visit for file:///c:/test.html",
iconUri: UrlbarUtils.ICON.DEFAULT, iconUri: UrlbarUtils.ICON.DEFAULT,
providerName: UNIFIEDCOMPLETE_PROVIDERNAME, providerName: PLACES_PROVIDERNAME,
}), }),
], ],
}); });

Просмотреть файл

@ -84,7 +84,7 @@ add_task(async function test_searchEngine_noautoFill() {
makeVisitResult(context, { makeVisitResult(context, {
uri: "http://my.search.com/samplepage/", uri: "http://my.search.com/samplepage/",
title: "test visit for http://my.search.com/samplepage/", title: "test visit for http://my.search.com/samplepage/",
providerName: "UnifiedComplete", providerName: "Places",
}), }),
], ],
}); });

Просмотреть файл

@ -454,10 +454,10 @@ add_task(async function test_special_searches() {
setSuggestPrefsToFalse(); setSuggestPrefsToFalse();
Services.prefs.setBoolPref("browser.urlbar.suggest.history", true); Services.prefs.setBoolPref("browser.urlbar.suggest.history", true);
Services.prefs.setBoolPref("browser.urlbar.suggest.bookmark", 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 // 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 // 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); Services.prefs.setIntPref("browser.urlbar.maxRichResults", 20);
context = createContext("foo", { isPrivate: false }); context = createContext("foo", { isPrivate: false });
await check_results({ await check_results({

Просмотреть файл

@ -40,6 +40,8 @@ skip-if = os == 'linux' # bug 1474616
[test_providerKeywords.js] [test_providerKeywords.js]
[test_providerOmnibox.js] [test_providerOmnibox.js]
[test_providerOpenTabs.js] [test_providerOpenTabs.js]
[test_providerPlaces.js]
[test_providerPlaces_duplicate_entries.js]
[test_providerPlaces_nonEnglish.js] [test_providerPlaces_nonEnglish.js]
[test_providerPreloaded.js] [test_providerPreloaded.js]
[test_providersManager.js] [test_providersManager.js]
@ -47,8 +49,6 @@ skip-if = os == 'linux' # bug 1474616
[test_providersManager_maxResults.js] [test_providersManager_maxResults.js]
[test_providerTabToSearch.js] [test_providerTabToSearch.js]
[test_providerTabToSearch_partialHost.js] [test_providerTabToSearch_partialHost.js]
[test_providerUnifiedComplete.js]
[test_providerUnifiedComplete_duplicate_entries.js]
[test_query_url.js] [test_query_url.js]
[test_queryScorer.js] [test_queryScorer.js]
[test_remote_tabs.js] [test_remote_tabs.js]