Bug 1791657: Introduce fallbackTitle into payload. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D159243
This commit is contained in:
@@ -828,32 +828,37 @@ class ProviderAutofill extends UrlbarProvider {
|
||||
}
|
||||
}
|
||||
|
||||
const hasTitle = title !== null;
|
||||
if (!hasTitle) {
|
||||
let payload = {
|
||||
url: [finalCompleteValue, UrlbarUtils.HIGHLIGHT.TYPED],
|
||||
icon: UrlbarUtils.getIconForUrl(finalCompleteValue),
|
||||
};
|
||||
|
||||
if (title) {
|
||||
payload.title = [title, UrlbarUtils.HIGHLIGHT.TYPED];
|
||||
} else {
|
||||
let [autofilled] = UrlbarUtils.stripPrefixAndTrim(finalCompleteValue, {
|
||||
stripHttp: true,
|
||||
trimEmptyQuery: true,
|
||||
trimSlash: !this._searchString.includes("/"),
|
||||
});
|
||||
title = [autofilled, UrlbarUtils.HIGHLIGHT.TYPED];
|
||||
payload.fallbackTitle = [autofilled, UrlbarUtils.HIGHLIGHT.TYPED];
|
||||
}
|
||||
|
||||
let result = new lazy.UrlbarResult(
|
||||
UrlbarUtils.RESULT_TYPE.URL,
|
||||
UrlbarUtils.RESULT_SOURCE.HISTORY,
|
||||
...lazy.UrlbarResult.payloadAndSimpleHighlights(queryContext.tokens, {
|
||||
title,
|
||||
url: [finalCompleteValue, UrlbarUtils.HIGHLIGHT.TYPED],
|
||||
icon: UrlbarUtils.getIconForUrl(finalCompleteValue),
|
||||
})
|
||||
...lazy.UrlbarResult.payloadAndSimpleHighlights(
|
||||
queryContext.tokens,
|
||||
payload
|
||||
)
|
||||
);
|
||||
|
||||
result.autofill = {
|
||||
adaptiveHistoryInput,
|
||||
value: autofilledValue,
|
||||
selectionStart: queryContext.searchString.length,
|
||||
selectionEnd: autofilledValue.length,
|
||||
type: autofilledType,
|
||||
hasTitle,
|
||||
};
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -125,9 +125,19 @@ export class UrlbarResult {
|
||||
this.payloadHighlights.qsSuggestion,
|
||||
];
|
||||
}
|
||||
return this.payload.title
|
||||
? [this.payload.title, this.payloadHighlights.title]
|
||||
: [this.payload.url || "", this.payloadHighlights.url || []];
|
||||
|
||||
if (this.payload.fallbackTitle) {
|
||||
return [
|
||||
this.payload.fallbackTitle,
|
||||
this.payloadHighlights.fallbackTitle,
|
||||
];
|
||||
}
|
||||
|
||||
if (this.payload.title) {
|
||||
return [this.payload.title, this.payloadHighlights.title];
|
||||
}
|
||||
|
||||
return [this.payload.url ?? "", this.payloadHighlights.url ?? []];
|
||||
case lazy.UrlbarUtils.RESULT_TYPE.SEARCH:
|
||||
if (this.payload.providesSearchMode) {
|
||||
return ["", []];
|
||||
@@ -226,6 +236,7 @@ export class UrlbarResult {
|
||||
|
||||
if (
|
||||
(!payloadInfo.title || !payloadInfo.title[0]) &&
|
||||
!payloadInfo.fallbackTitle &&
|
||||
payloadInfo.url &&
|
||||
typeof payloadInfo.url[0] == "string"
|
||||
) {
|
||||
|
||||
@@ -1537,6 +1537,9 @@ UrlbarUtils.RESULT_PAYLOAD_SCHEMA = {
|
||||
displayUrl: {
|
||||
type: "string",
|
||||
},
|
||||
fallbackTitle: {
|
||||
type: "string",
|
||||
},
|
||||
// l10n { id, args }
|
||||
helpL10n: {
|
||||
type: "object",
|
||||
|
||||
@@ -1546,7 +1546,7 @@ export class UrlbarView {
|
||||
isRowSelectable = false;
|
||||
break;
|
||||
default:
|
||||
if (result.heuristic && !result.autofill?.hasTitle) {
|
||||
if (result.heuristic && (!result.autofill || !result.payload.title)) {
|
||||
isVisitAction = true;
|
||||
} else if (result.providerName != "UrlbarProviderQuickSuggest") {
|
||||
setURL = true;
|
||||
|
||||
@@ -84,7 +84,7 @@ async function heuristicIsNotRestyled(expectedType, resultDetails) {
|
||||
if (
|
||||
expectedType === UrlbarUtils.RESULT_TYPE.URL &&
|
||||
resultDetails.result.heuristic &&
|
||||
resultDetails.result.autofill?.hasTitle
|
||||
resultDetails.result.payload.title
|
||||
) {
|
||||
Assert.equal(
|
||||
resultDetails.displayed.url,
|
||||
|
||||
@@ -821,6 +821,9 @@ function makeSearchResult(
|
||||
* @param {object} options Options for the result.
|
||||
* @param {string} options.title
|
||||
* The page title.
|
||||
* @param {string} [options.fallbackTitle]
|
||||
* The provider has capability to use the actual page title though,
|
||||
* when the provider can’t get the page title, use this value as the fallback.
|
||||
* @param {string} options.uri
|
||||
* The page URI.
|
||||
* @param {Array} [options.tags]
|
||||
@@ -840,6 +843,7 @@ function makeVisitResult(
|
||||
queryContext,
|
||||
{
|
||||
title,
|
||||
fallbackTitle,
|
||||
uri,
|
||||
iconUri,
|
||||
providerName,
|
||||
@@ -850,9 +854,16 @@ function makeVisitResult(
|
||||
) {
|
||||
let payload = {
|
||||
url: [uri, UrlbarUtils.HIGHLIGHT.TYPED],
|
||||
title: [title, UrlbarUtils.HIGHLIGHT.TYPED],
|
||||
};
|
||||
|
||||
if (title) {
|
||||
payload.title = [title, UrlbarUtils.HIGHLIGHT.TYPED];
|
||||
}
|
||||
|
||||
if (fallbackTitle) {
|
||||
payload.fallbackTitle = [fallbackTitle, UrlbarUtils.HIGHLIGHT.TYPED];
|
||||
}
|
||||
|
||||
if (iconUri) {
|
||||
payload.icon = iconUri;
|
||||
} else if (
|
||||
@@ -895,8 +906,6 @@ function makeVisitResult(
|
||||
* @param {string} [options.completed]
|
||||
* The value that would be filled if the autofill result was confirmed.
|
||||
* Has no effect if `autofilled` is not specified.
|
||||
* @param {boolean} [options.hasAutofillTitle]
|
||||
* The expected value of the `autofill.hasTitle` property of the first result.
|
||||
* @param {Array} options.matches
|
||||
* An array of UrlbarResults.
|
||||
*/
|
||||
@@ -905,7 +914,6 @@ async function check_results({
|
||||
incompleteSearch,
|
||||
autofilled,
|
||||
completed,
|
||||
hasAutofillTitle,
|
||||
matches = [],
|
||||
} = {}) {
|
||||
if (!context) {
|
||||
@@ -961,11 +969,6 @@ async function check_results({
|
||||
"The completed autofill value is correct."
|
||||
);
|
||||
}
|
||||
Assert.equal(
|
||||
context.results[0].autofill.hasTitle,
|
||||
hasAutofillTitle,
|
||||
"The hasTitle flag is correct."
|
||||
);
|
||||
}
|
||||
if (context.results.length != matches.length) {
|
||||
info("Actual results: " + JSON.stringify(context.results));
|
||||
|
||||
@@ -23,7 +23,6 @@ const TEST_DATA = [
|
||||
expected: {
|
||||
autofilled: "example.com/test",
|
||||
completed: "http://example.com/test",
|
||||
hasAutofillTitle: true,
|
||||
results: [
|
||||
context =>
|
||||
makeVisitResult(context, {
|
||||
@@ -43,7 +42,6 @@ const TEST_DATA = [
|
||||
expected: {
|
||||
autofilled: "example.com/test",
|
||||
completed: "http://www.example.com/test",
|
||||
hasAutofillTitle: true,
|
||||
results: [
|
||||
context =>
|
||||
makeVisitResult(context, {
|
||||
@@ -63,7 +61,6 @@ const TEST_DATA = [
|
||||
expected: {
|
||||
autofilled: "www.example.com/test",
|
||||
completed: "http://www.example.com/test",
|
||||
hasAutofillTitle: true,
|
||||
results: [
|
||||
context =>
|
||||
makeVisitResult(context, {
|
||||
@@ -83,7 +80,6 @@ const TEST_DATA = [
|
||||
expected: {
|
||||
autofilled: "eXAmple.com/test",
|
||||
completed: "http://example.com/test",
|
||||
hasAutofillTitle: true,
|
||||
results: [
|
||||
context =>
|
||||
makeVisitResult(context, {
|
||||
@@ -104,7 +100,6 @@ const TEST_DATA = [
|
||||
expected: {
|
||||
autofilled: "WWW.example.com/test",
|
||||
completed: "http://www.example.com/test",
|
||||
hasAutofillTitle: true,
|
||||
results: [
|
||||
context =>
|
||||
makeVisitResult(context, {
|
||||
@@ -133,7 +128,6 @@ const TEST_DATA = [
|
||||
expected: {
|
||||
autofilled: "example.com/yes",
|
||||
completed: "http://example.com/yes",
|
||||
hasAutofillTitle: true,
|
||||
results: [
|
||||
context =>
|
||||
makeVisitResult(context, {
|
||||
@@ -162,7 +156,6 @@ const TEST_DATA = [
|
||||
expected: {
|
||||
autofilled: "example.com/many",
|
||||
completed: "http://example.com/many",
|
||||
hasAutofillTitle: true,
|
||||
results: [
|
||||
context =>
|
||||
makeVisitResult(context, {
|
||||
@@ -191,7 +184,6 @@ const TEST_DATA = [
|
||||
expected: {
|
||||
autofilled: "example.com/many",
|
||||
completed: "http://example.com/many",
|
||||
hasAutofillTitle: true,
|
||||
results: [
|
||||
context =>
|
||||
makeVisitResult(context, {
|
||||
@@ -224,7 +216,6 @@ const TEST_DATA = [
|
||||
expected: {
|
||||
autofilled: "example.com/many",
|
||||
completed: "http://example.com/many",
|
||||
hasAutofillTitle: true,
|
||||
results: [
|
||||
context =>
|
||||
makeVisitResult(context, {
|
||||
@@ -249,12 +240,11 @@ const TEST_DATA = [
|
||||
expected: {
|
||||
autofilled: "example.com/",
|
||||
completed: "http://example.com/",
|
||||
hasAutofillTitle: false,
|
||||
results: [
|
||||
context =>
|
||||
makeVisitResult(context, {
|
||||
uri: "http://example.com/",
|
||||
title: "example.com",
|
||||
fallbackTitle: "example.com",
|
||||
heuristic: true,
|
||||
}),
|
||||
context =>
|
||||
@@ -274,7 +264,6 @@ const TEST_DATA = [
|
||||
expected: {
|
||||
autofilled: "example.com/test",
|
||||
completed: "http://example.com/test",
|
||||
hasAutofillTitle: true,
|
||||
results: [
|
||||
context =>
|
||||
makeVisitResult(context, {
|
||||
@@ -295,7 +284,6 @@ const TEST_DATA = [
|
||||
expected: {
|
||||
autofilled: "example.com/test",
|
||||
completed: "http://example.com/test",
|
||||
hasAutofillTitle: true,
|
||||
results: [
|
||||
context =>
|
||||
makeVisitResult(context, {
|
||||
@@ -315,12 +303,11 @@ const TEST_DATA = [
|
||||
expected: {
|
||||
autofilled: "example.org/",
|
||||
completed: "http://example.org/",
|
||||
hasAutofillTitle: false,
|
||||
results: [
|
||||
context =>
|
||||
makeVisitResult(context, {
|
||||
uri: "http://example.org/",
|
||||
title: "example.org",
|
||||
fallbackTitle: "example.org",
|
||||
heuristic: true,
|
||||
}),
|
||||
context =>
|
||||
@@ -340,12 +327,11 @@ const TEST_DATA = [
|
||||
expected: {
|
||||
autofilled: "example.com/",
|
||||
completed: "http://example.com/",
|
||||
hasAutofillTitle: false,
|
||||
results: [
|
||||
context =>
|
||||
makeVisitResult(context, {
|
||||
uri: "http://example.com/",
|
||||
title: "example.com",
|
||||
fallbackTitle: "example.com",
|
||||
heuristic: true,
|
||||
}),
|
||||
context =>
|
||||
@@ -409,7 +395,6 @@ const TEST_DATA = [
|
||||
expected: {
|
||||
autofilled: "example.com/test",
|
||||
completed: "http://example.com/test",
|
||||
hasAutofillTitle: true,
|
||||
results: [
|
||||
context =>
|
||||
makeVisitResult(context, {
|
||||
@@ -430,7 +415,6 @@ const TEST_DATA = [
|
||||
expected: {
|
||||
autofilled: "example.com/test",
|
||||
completed: "http://example.com/test",
|
||||
hasAutofillTitle: true,
|
||||
results: [
|
||||
context =>
|
||||
makeVisitResult(context, {
|
||||
@@ -480,7 +464,6 @@ const TEST_DATA = [
|
||||
expected: {
|
||||
autofilled: "example.com/bookmarked",
|
||||
completed: "http://example.com/bookmarked",
|
||||
hasAutofillTitle: true,
|
||||
results: [
|
||||
context =>
|
||||
makeVisitResult(context, {
|
||||
@@ -518,7 +501,6 @@ const TEST_DATA = [
|
||||
expected: {
|
||||
autofilled: "example.com/bookmarked",
|
||||
completed: "http://example.com/bookmarked",
|
||||
hasAutofillTitle: true,
|
||||
results: [
|
||||
context =>
|
||||
makeVisitResult(context, {
|
||||
@@ -575,7 +557,6 @@ const TEST_DATA = [
|
||||
expected: {
|
||||
autofilled: "example.com/test",
|
||||
completed: "http://example.com/test",
|
||||
hasAutofillTitle: true,
|
||||
results: [
|
||||
context =>
|
||||
makeVisitResult(context, {
|
||||
@@ -607,7 +588,6 @@ const TEST_DATA = [
|
||||
expected: {
|
||||
autofilled: "http://example.com/test",
|
||||
completed: "http://example.com/test",
|
||||
hasAutofillTitle: true,
|
||||
results: [
|
||||
context =>
|
||||
makeVisitResult(context, {
|
||||
@@ -639,7 +619,6 @@ const TEST_DATA = [
|
||||
expected: {
|
||||
autofilled: "http://example.com/test",
|
||||
completed: "http://example.com/test",
|
||||
hasAutofillTitle: true,
|
||||
results: [
|
||||
context =>
|
||||
makeVisitResult(context, {
|
||||
@@ -671,7 +650,6 @@ const TEST_DATA = [
|
||||
expected: {
|
||||
autofilled: "example.com/testMany",
|
||||
completed: "http://example.com/testMany",
|
||||
hasAutofillTitle: true,
|
||||
results: [
|
||||
context =>
|
||||
makeVisitResult(context, {
|
||||
@@ -759,7 +737,6 @@ const TEST_DATA = [
|
||||
expected: {
|
||||
autofilled: "http://example.com/test",
|
||||
completed: "http://example.com/test",
|
||||
hasAutofillTitle: true,
|
||||
results: [
|
||||
context =>
|
||||
makeVisitResult(context, {
|
||||
@@ -779,7 +756,6 @@ const TEST_DATA = [
|
||||
expected: {
|
||||
autofilled: "http://example.com/test",
|
||||
completed: "http://example.com/test",
|
||||
hasAutofillTitle: true,
|
||||
results: [
|
||||
context =>
|
||||
makeVisitResult(context, {
|
||||
@@ -800,7 +776,6 @@ const TEST_DATA = [
|
||||
expected: {
|
||||
autofilled: "http://example.com/test",
|
||||
completed: "http://www.example.com/test",
|
||||
hasAutofillTitle: true,
|
||||
results: [
|
||||
context =>
|
||||
makeVisitResult(context, {
|
||||
@@ -824,7 +799,6 @@ const TEST_DATA = [
|
||||
expected: {
|
||||
autofilled: "http.example.com/test",
|
||||
completed: "http://http.example.com/test",
|
||||
hasAutofillTitle: true,
|
||||
results: [
|
||||
context =>
|
||||
makeVisitResult(context, {
|
||||
@@ -879,7 +853,6 @@ const TEST_DATA = [
|
||||
expected: {
|
||||
autofilled: "totally.example.com/",
|
||||
completed: "http://totally.example.com/",
|
||||
hasAutofillTitle: true,
|
||||
results: [
|
||||
context =>
|
||||
makeVisitResult(context, {
|
||||
@@ -908,7 +881,6 @@ const TEST_DATA = [
|
||||
expected: {
|
||||
autofilled: "example.com/test",
|
||||
completed: "http://example.com/test",
|
||||
hasAutofillTitle: true,
|
||||
results: [
|
||||
context =>
|
||||
makeVisitResult(context, {
|
||||
@@ -934,7 +906,6 @@ const TEST_DATA = [
|
||||
expected: {
|
||||
autofilled: "example.com/test",
|
||||
completed: "http://example.com/test",
|
||||
hasAutofillTitle: true,
|
||||
results: [
|
||||
context =>
|
||||
makeVisitResult(context, {
|
||||
@@ -961,12 +932,11 @@ const TEST_DATA = [
|
||||
expected: {
|
||||
autofilled: "example.com/",
|
||||
completed: "http://example.com/",
|
||||
hasAutofillTitle: false,
|
||||
results: [
|
||||
context =>
|
||||
makeVisitResult(context, {
|
||||
uri: "http://example.com/",
|
||||
title: "example.com",
|
||||
fallbackTitle: "example.com",
|
||||
heuristic: true,
|
||||
}),
|
||||
context =>
|
||||
@@ -987,7 +957,6 @@ const TEST_DATA = [
|
||||
expected: {
|
||||
autofilled: "example.com/test",
|
||||
completed: "http://example.com/test",
|
||||
hasAutofillTitle: true,
|
||||
results: [
|
||||
context =>
|
||||
makeVisitResult(context, {
|
||||
@@ -1008,7 +977,6 @@ const TEST_DATA = [
|
||||
expected: {
|
||||
autofilled: "example.com/test",
|
||||
completed: "http://example.com/test",
|
||||
hasAutofillTitle: true,
|
||||
results: [
|
||||
context =>
|
||||
makeVisitResult(context, {
|
||||
@@ -1029,12 +997,11 @@ const TEST_DATA = [
|
||||
expected: {
|
||||
autofilled: "example.com/",
|
||||
completed: "http://example.com/",
|
||||
hasAutofillTitle: false,
|
||||
results: [
|
||||
context =>
|
||||
makeVisitResult(context, {
|
||||
uri: "http://example.com/",
|
||||
title: "example.com",
|
||||
fallbackTitle: "example.com",
|
||||
heuristic: true,
|
||||
}),
|
||||
context =>
|
||||
@@ -1062,7 +1029,6 @@ const TEST_DATA = [
|
||||
expected: {
|
||||
autofilled: "example.com/test",
|
||||
completed: "http://example.com/test",
|
||||
hasAutofillTitle: true,
|
||||
results: [
|
||||
context =>
|
||||
makeVisitResult(context, {
|
||||
@@ -1090,12 +1056,11 @@ const TEST_DATA = [
|
||||
expected: {
|
||||
autofilled: "example.com/test",
|
||||
completed: "http://example.com/test",
|
||||
hasAutofillTitle: false,
|
||||
results: [
|
||||
context =>
|
||||
makeVisitResult(context, {
|
||||
uri: "http://example.com/test",
|
||||
title: "example.com/test",
|
||||
fallbackTitle: "example.com/test",
|
||||
heuristic: true,
|
||||
}),
|
||||
context =>
|
||||
@@ -1117,11 +1082,11 @@ const TEST_DATA = [
|
||||
expected: {
|
||||
autofilled: "example.com/",
|
||||
completed: "http://example.com/",
|
||||
hasAutofillTitle: false,
|
||||
results: [
|
||||
context =>
|
||||
makeVisitResult(context, {
|
||||
uri: "http://example.com/",
|
||||
fallbackTitle: "example.com",
|
||||
heuristic: true,
|
||||
}),
|
||||
context =>
|
||||
@@ -1163,11 +1128,11 @@ const TEST_DATA = [
|
||||
expected: {
|
||||
autofilled: "example.com/",
|
||||
completed: "http://example.com/",
|
||||
hasAutofillTitle: false,
|
||||
results: [
|
||||
context =>
|
||||
makeVisitResult(context, {
|
||||
uri: "http://example.com/",
|
||||
fallbackTitle: "example.com",
|
||||
heuristic: true,
|
||||
}),
|
||||
],
|
||||
@@ -1185,11 +1150,11 @@ const TEST_DATA = [
|
||||
expected: {
|
||||
autofilled: "example.com/",
|
||||
completed: "http://example.com/",
|
||||
hasAutofillTitle: false,
|
||||
results: [
|
||||
context =>
|
||||
makeVisitResult(context, {
|
||||
uri: "http://example.com/",
|
||||
fallbackTitle: "example.com",
|
||||
heuristic: true,
|
||||
}),
|
||||
context =>
|
||||
@@ -1209,12 +1174,11 @@ const TEST_DATA = [
|
||||
expected: {
|
||||
autofilled: "example.com/",
|
||||
completed: "http://example.com/",
|
||||
hasAutofillTitle: false,
|
||||
results: [
|
||||
context =>
|
||||
makeVisitResult(context, {
|
||||
uri: "http://example.com/",
|
||||
title: "example.com",
|
||||
fallbackTitle: "example.com",
|
||||
heuristic: true,
|
||||
}),
|
||||
context =>
|
||||
@@ -1234,12 +1198,11 @@ const TEST_DATA = [
|
||||
expected: {
|
||||
autofilled: "example.com/",
|
||||
completed: "http://example.com/",
|
||||
hasAutofillTitle: false,
|
||||
results: [
|
||||
context =>
|
||||
makeVisitResult(context, {
|
||||
uri: "http://example.com/",
|
||||
title: "example.com",
|
||||
fallbackTitle: "example.com",
|
||||
heuristic: true,
|
||||
}),
|
||||
context =>
|
||||
@@ -1348,13 +1311,15 @@ add_task(async function urlCase() {
|
||||
const context = createContext(currentUserInput, { isPrivate: false });
|
||||
|
||||
if (currentUserInput.length < testInput.length) {
|
||||
// Not autofill.
|
||||
// Autofill with host.
|
||||
await check_results({
|
||||
context,
|
||||
autofilled: "example.com/",
|
||||
completed: "http://example.com/",
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "http://example.com/",
|
||||
title: "example.com",
|
||||
fallbackTitle: "example.com",
|
||||
heuristic: true,
|
||||
}),
|
||||
makeVisitResult(context, {
|
||||
@@ -1370,7 +1335,6 @@ add_task(async function urlCase() {
|
||||
context,
|
||||
autofilled,
|
||||
completed: "http://example.com/ABC/DEF",
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "http://example.com/ABC/DEF",
|
||||
@@ -1385,11 +1349,10 @@ add_task(async function urlCase() {
|
||||
context,
|
||||
autofilled: "example.COM/abc/def",
|
||||
completed: "http://example.com/abc/def",
|
||||
hasAutofillTitle: false,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "http://example.com/abc/def",
|
||||
title: "example.com/abc/def",
|
||||
fallbackTitle: "example.com/abc/def",
|
||||
heuristic: true,
|
||||
}),
|
||||
makeVisitResult(context, {
|
||||
@@ -1416,7 +1379,6 @@ add_task(async function decayTest() {
|
||||
context: initContext,
|
||||
autofilled: "example.com/test",
|
||||
completed: "http://example.com/test",
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(initContext, {
|
||||
uri: "http://example.com/test",
|
||||
@@ -1442,7 +1404,6 @@ add_task(async function decayTest() {
|
||||
context: midContext,
|
||||
autofilled: "example.com/test",
|
||||
completed: "http://example.com/test",
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(midContext, {
|
||||
uri: "http://example.com/test",
|
||||
@@ -1461,11 +1422,10 @@ add_task(async function decayTest() {
|
||||
context,
|
||||
autofilled: "example.com/",
|
||||
completed: "http://example.com/",
|
||||
hasAutofillTitle: false,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "http://example.com/",
|
||||
title: "example.com",
|
||||
fallbackTitle: "example.com",
|
||||
heuristic: true,
|
||||
}),
|
||||
makeVisitResult(context, {
|
||||
|
||||
@@ -56,7 +56,6 @@ add_task(async function() {
|
||||
context,
|
||||
autofilled: `${host}/`,
|
||||
completed: `https://${host}/`,
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: `https://${host}/`,
|
||||
@@ -112,11 +111,10 @@ add_task(async function test_www() {
|
||||
context,
|
||||
autofilled: `www.${host}/`,
|
||||
completed: `http://www.${host}/`,
|
||||
hasAutofillTitle: false,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: `http://www.${host}/`,
|
||||
title: `www.${host}`,
|
||||
fallbackTitle: `www.${host}`,
|
||||
heuristic: true,
|
||||
}),
|
||||
],
|
||||
@@ -127,11 +125,10 @@ add_task(async function test_www() {
|
||||
context,
|
||||
autofilled: `www.${host}/`,
|
||||
completed: `http://www.${host}/`,
|
||||
hasAutofillTitle: false,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: `http://www.${host}/`,
|
||||
title: `www.${host}`,
|
||||
fallbackTitle: `www.${host}`,
|
||||
heuristic: true,
|
||||
}),
|
||||
],
|
||||
@@ -142,11 +139,10 @@ add_task(async function test_www() {
|
||||
context,
|
||||
autofilled: `${host}/`,
|
||||
completed: `http://www.${host}/`,
|
||||
hasAutofillTitle: false,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: `http://www.${host}/`,
|
||||
title: `www.${host}`,
|
||||
fallbackTitle: `www.${host}`,
|
||||
heuristic: true,
|
||||
}),
|
||||
],
|
||||
|
||||
@@ -26,7 +26,6 @@ add_task(async function test_urls_order() {
|
||||
context,
|
||||
autofilled: "visit2.mozilla.org/",
|
||||
completed: "http://visit2.mozilla.org/",
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "http://visit2.mozilla.org/",
|
||||
@@ -55,7 +54,6 @@ add_task(async function test_bookmark_first() {
|
||||
context,
|
||||
autofilled: "bookmark1.mozilla.org/",
|
||||
completed: "http://bookmark1.mozilla.org/",
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "http://bookmark1.mozilla.org/",
|
||||
@@ -81,7 +79,6 @@ add_task(async function test_complete_querystring() {
|
||||
context,
|
||||
autofilled: "smokey.mozilla.org/foo?bacon=delicious",
|
||||
completed: "http://smokey.mozilla.org/foo?bacon=delicious",
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "http://smokey.mozilla.org/foo?bacon=delicious",
|
||||
@@ -105,7 +102,6 @@ add_task(async function test_complete_fragment() {
|
||||
context,
|
||||
autofilled: "smokey.mozilla.org/foo?bacon=delicious#bar",
|
||||
completed: "http://smokey.mozilla.org/foo?bacon=delicious#bar",
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "http://smokey.mozilla.org/foo?bacon=delicious#bar",
|
||||
|
||||
@@ -37,7 +37,6 @@ add_task(async function trailingSlash() {
|
||||
context,
|
||||
autofilled: `${origin}/`,
|
||||
completed: `http://${origin}/`,
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: `http://${origin}/`,
|
||||
@@ -62,7 +61,6 @@ add_task(async function trailingSlashWWW() {
|
||||
context,
|
||||
autofilled: "example.com/",
|
||||
completed: "http://www.example.com/",
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: `http://www.${origin}/`,
|
||||
@@ -86,7 +84,6 @@ add_task(async function port() {
|
||||
context,
|
||||
autofilled: "example.com:8888/",
|
||||
completed: "http://example.com:8888/",
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: `http://${origin}:8888/`,
|
||||
@@ -111,7 +108,6 @@ add_task(async function portPartial() {
|
||||
context,
|
||||
autofilled: "example.com:8888/",
|
||||
completed: "http://example.com:8888/",
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: `http://${origin}:8888/`,
|
||||
@@ -136,7 +132,6 @@ add_task(async function preserveCase() {
|
||||
context,
|
||||
autofilled: "EXaMple.com/",
|
||||
completed: "http://example.com/",
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: `http://${origin}/`,
|
||||
@@ -162,7 +157,6 @@ add_task(async function preserveCasePort() {
|
||||
context,
|
||||
autofilled: "EXaMple.com:8888/",
|
||||
completed: "http://example.com:8888/",
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: `http://${origin}:8888/`,
|
||||
@@ -258,7 +252,6 @@ add_task(async function multidotted() {
|
||||
context,
|
||||
autofilled: "www.example.co.jp:8888/",
|
||||
completed: "http://www.example.co.jp:8888/",
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "http://www.example.co.jp:8888/",
|
||||
@@ -290,7 +283,6 @@ add_task(async function test_ip() {
|
||||
context,
|
||||
autofilled: str,
|
||||
completed: "http://" + str,
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "http://" + str,
|
||||
@@ -317,7 +309,6 @@ add_task(async function large_number_host() {
|
||||
context,
|
||||
autofilled: "12345example.it:8888/",
|
||||
completed: "http://12345example.it:8888/",
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "http://12345example.it:8888/",
|
||||
@@ -375,7 +366,6 @@ add_task(async function groupByHost() {
|
||||
context,
|
||||
autofilled: "example.com/",
|
||||
completed: "https://example.com/",
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "https://example.com/",
|
||||
@@ -441,7 +431,6 @@ add_task(async function groupByHostNonDefaultStddevMultiplier() {
|
||||
context,
|
||||
autofilled: "example.com/",
|
||||
completed: "https://example.com/",
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "https://example.com/",
|
||||
@@ -533,11 +522,10 @@ add_task(async function suggestHistoryFalse_bookmark_multiple() {
|
||||
context,
|
||||
autofilled: "example.com/",
|
||||
completed: baseURL,
|
||||
hasAutofillTitle: false,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: baseURL,
|
||||
title: "example.com",
|
||||
fallbackTitle: "example.com",
|
||||
heuristic: true,
|
||||
}),
|
||||
makeBookmarkResult(context, {
|
||||
@@ -637,11 +625,10 @@ add_task(async function suggestHistoryFalse_bookmark_prefix_multiple() {
|
||||
context,
|
||||
autofilled: "http://example.com/",
|
||||
completed: baseURL,
|
||||
hasAutofillTitle: false,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: baseURL,
|
||||
title: "example.com",
|
||||
fallbackTitle: "example.com",
|
||||
heuristic: true,
|
||||
}),
|
||||
makeBookmarkResult(context, {
|
||||
@@ -697,7 +684,6 @@ add_task(async function searchParams() {
|
||||
context,
|
||||
autofilled: "example.com/",
|
||||
completed: "http://example.com/",
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "http://example.com/",
|
||||
@@ -759,7 +745,6 @@ add_task(async function searchParams_https() {
|
||||
context,
|
||||
autofilled: "example.com/",
|
||||
completed: "https://example.com/",
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "https://example.com/",
|
||||
@@ -794,7 +779,6 @@ add_task(async function originLooksLikePrefix() {
|
||||
context,
|
||||
autofilled: hostAndPort + "/",
|
||||
completed: address,
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: address,
|
||||
|
||||
@@ -76,7 +76,6 @@ add_autofill_task(async function basic() {
|
||||
context,
|
||||
autofilled: url,
|
||||
completed: "http://" + url,
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "http://" + url,
|
||||
@@ -100,7 +99,6 @@ add_autofill_task(async function basicCase() {
|
||||
context,
|
||||
autofilled: searchCase + url.substr(searchCase.length),
|
||||
completed: "http://" + url,
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "http://" + url,
|
||||
@@ -124,7 +122,6 @@ add_autofill_task(async function noWWWShouldMatchWWW() {
|
||||
context,
|
||||
autofilled: url,
|
||||
completed: "http://www." + url,
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "http://www." + url,
|
||||
@@ -148,7 +145,6 @@ add_autofill_task(async function noWWWShouldMatchWWWCase() {
|
||||
context,
|
||||
autofilled: searchCase + url.substr(searchCase.length),
|
||||
completed: "http://www." + url,
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "http://www." + url,
|
||||
@@ -216,7 +212,6 @@ add_autofill_task(async function prefix() {
|
||||
context,
|
||||
autofilled: "http://" + url,
|
||||
completed: "http://" + url,
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "http://" + url,
|
||||
@@ -240,7 +235,6 @@ add_autofill_task(async function prefixCase() {
|
||||
context,
|
||||
autofilled: "HTTP://" + searchCase + url.substr(searchCase.length),
|
||||
completed: "http://" + url,
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "http://" + url,
|
||||
@@ -264,7 +258,6 @@ add_autofill_task(async function prefixNoWWWShouldMatchWWW() {
|
||||
context,
|
||||
autofilled: "http://" + url,
|
||||
completed: "http://www." + url,
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "http://www." + url,
|
||||
@@ -288,7 +281,6 @@ add_autofill_task(async function prefixNoWWWShouldMatchWWWCase() {
|
||||
context,
|
||||
autofilled: "HTTP://" + searchCase + url.substr(searchCase.length),
|
||||
completed: "http://www." + url,
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "http://www." + url,
|
||||
@@ -367,7 +359,6 @@ add_autofill_task(async function httpsBasic() {
|
||||
context,
|
||||
autofilled: url,
|
||||
completed: "https://" + url,
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "https://" + url,
|
||||
@@ -391,7 +382,6 @@ add_autofill_task(async function httpsNoWWWShouldMatchWWW() {
|
||||
context,
|
||||
autofilled: url,
|
||||
completed: "https://www." + url,
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "https://www." + url,
|
||||
@@ -459,7 +449,6 @@ add_autofill_task(async function httpsPrefix() {
|
||||
context,
|
||||
autofilled: "https://" + url,
|
||||
completed: "https://" + url,
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "https://" + url,
|
||||
@@ -483,7 +472,6 @@ add_autofill_task(async function httpsPrefixNoWWWShouldMatchWWW() {
|
||||
context,
|
||||
autofilled: "https://" + url,
|
||||
completed: "https://www." + url,
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "https://www." + url,
|
||||
@@ -576,7 +564,6 @@ add_autofill_task(async function httpsPrefixShouldNotMatchMoreFrecentHTTP() {
|
||||
context,
|
||||
autofilled: "https://" + url,
|
||||
completed: "https://" + url,
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "https://" + url,
|
||||
@@ -601,7 +588,6 @@ add_autofill_task(async function frecency() {
|
||||
context,
|
||||
autofilled: url,
|
||||
completed: "http://" + url,
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "http://" + url,
|
||||
@@ -620,7 +606,6 @@ add_autofill_task(async function frecency() {
|
||||
context,
|
||||
autofilled: url,
|
||||
completed: "https://" + url,
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "https://" + url,
|
||||
@@ -640,7 +625,6 @@ add_autofill_task(async function frecency() {
|
||||
context,
|
||||
autofilled: url,
|
||||
completed: "http://" + url,
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "http://" + url,
|
||||
@@ -664,7 +648,6 @@ add_autofill_task(async function frecency() {
|
||||
context,
|
||||
autofilled: url,
|
||||
completed: "https://www." + url,
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "https://www." + url,
|
||||
@@ -688,7 +671,6 @@ add_autofill_task(async function frecency() {
|
||||
context,
|
||||
autofilled: url,
|
||||
completed: "http://" + url,
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "http://" + url,
|
||||
@@ -712,7 +694,6 @@ add_autofill_task(async function frecency() {
|
||||
context,
|
||||
autofilled: url,
|
||||
completed: "https://" + url,
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "https://" + url,
|
||||
@@ -731,7 +712,6 @@ add_autofill_task(async function frecency() {
|
||||
context,
|
||||
autofilled: url,
|
||||
completed: "https://" + url,
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "https://" + url,
|
||||
@@ -784,7 +764,6 @@ add_autofill_task(async function frecency() {
|
||||
context,
|
||||
autofilled: url,
|
||||
completed: "https://" + url,
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "https://" + url,
|
||||
@@ -809,7 +788,6 @@ add_autofill_task(async function frecency() {
|
||||
context,
|
||||
autofilled: url,
|
||||
completed: "https://" + url,
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "https://" + url,
|
||||
@@ -896,7 +874,6 @@ add_autofill_task(async function bookmarkBelowThreshold() {
|
||||
context,
|
||||
autofilled: url,
|
||||
completed: "http://" + url,
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "http://" + url,
|
||||
@@ -939,7 +916,6 @@ add_autofill_task(async function bookmarkAboveThreshold() {
|
||||
context,
|
||||
autofilled: url,
|
||||
completed: "http://" + url,
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "http://" + url,
|
||||
@@ -985,7 +961,6 @@ add_autofill_task(async function zeroThreshold() {
|
||||
context,
|
||||
autofilled: url,
|
||||
completed: "http://" + url,
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "http://" + url,
|
||||
@@ -1017,7 +992,6 @@ add_autofill_task(async function suggestHistoryFalse_visit() {
|
||||
context,
|
||||
autofilled: url,
|
||||
completed: "http://" + url,
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "http://" + url,
|
||||
@@ -1076,7 +1050,6 @@ add_autofill_task(async function suggestHistoryFalse_visit_prefix() {
|
||||
context,
|
||||
autofilled: "http://" + url,
|
||||
completed: "http://" + url,
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "http://" + url,
|
||||
@@ -1158,7 +1131,6 @@ add_autofill_task(async function suggestHistoryFalse_bookmark_0() {
|
||||
context,
|
||||
autofilled: url,
|
||||
completed: "http://" + url,
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "http://" + url,
|
||||
@@ -1266,7 +1238,6 @@ add_autofill_task(async function suggestHistoryFalse_bookmark_prefix_0() {
|
||||
context,
|
||||
autofilled: "http://" + url,
|
||||
completed: "http://" + url,
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "http://" + url,
|
||||
@@ -1415,7 +1386,6 @@ add_autofill_task(async function suggestBookmarkFalse_visit_0() {
|
||||
context,
|
||||
autofilled: url,
|
||||
completed: "http://" + url,
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "http://" + url,
|
||||
@@ -1498,7 +1468,6 @@ add_autofill_task(async function suggestBookmarkFalse_visit_prefix_0() {
|
||||
context,
|
||||
autofilled: "http://" + url,
|
||||
completed: "http://" + url,
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "http://" + url,
|
||||
@@ -1645,7 +1614,6 @@ add_autofill_task(async function suggestBookmarkFalse_unvisitedBookmark() {
|
||||
context,
|
||||
autofilled: url,
|
||||
completed: "http://" + url,
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "http://" + url,
|
||||
@@ -1707,7 +1675,6 @@ add_autofill_task(
|
||||
context,
|
||||
autofilled: "http://" + url,
|
||||
completed: "http://" + url,
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "http://" + url,
|
||||
@@ -1870,7 +1837,6 @@ add_autofill_task(async function suggestBookmarkFalse_visitedBookmark_above() {
|
||||
context,
|
||||
autofilled: url,
|
||||
completed: "http://" + url,
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "http://" + url,
|
||||
@@ -1906,7 +1872,6 @@ add_autofill_task(
|
||||
context,
|
||||
autofilled: "http://" + url,
|
||||
completed: "http://" + url,
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "http://" + url,
|
||||
@@ -2457,7 +2422,6 @@ add_autofill_task(async function hideHeuristic() {
|
||||
context,
|
||||
autofilled: url,
|
||||
completed: "http://" + url,
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "http://" + url,
|
||||
|
||||
@@ -32,11 +32,10 @@ add_task(async function() {
|
||||
context,
|
||||
autofilled: `${host}/`,
|
||||
completed: `https://www.${host}/`,
|
||||
hasAutofillTitle: false,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: `https://www.${host}/`,
|
||||
title: `https://www.${host}`,
|
||||
fallbackTitle: `https://www.${host}`,
|
||||
heuristic: true,
|
||||
}),
|
||||
makeBookmarkResult(context, {
|
||||
@@ -62,11 +61,10 @@ add_task(async function() {
|
||||
context,
|
||||
autofilled: `${host}/`,
|
||||
completed: `https://${host}/`,
|
||||
hasAutofillTitle: false,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: `https://${host}/`,
|
||||
title: `https://${host}`,
|
||||
fallbackTitle: `https://${host}`,
|
||||
heuristic: true,
|
||||
}),
|
||||
makeBookmarkResult(context, {
|
||||
|
||||
@@ -26,7 +26,6 @@ add_task(async function multipleSlashes() {
|
||||
context,
|
||||
autofilled: "example.com/foo/",
|
||||
completed: "http://example.com/foo/",
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "http://example.com/foo/",
|
||||
@@ -50,7 +49,6 @@ add_task(async function port() {
|
||||
context,
|
||||
autofilled: "example.com:8888/foo",
|
||||
completed: "http://example.com:8888/foo",
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "http://example.com:8888/foo",
|
||||
@@ -98,11 +96,10 @@ add_task(async function port() {
|
||||
context,
|
||||
autofilled: "example.com:8888/foo/bar/",
|
||||
completed: "http://example.com:8888/foo/bar/",
|
||||
hasAutofillTitle: false,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "http://example.com:8888/foo/bar/",
|
||||
title: "example.com:8888/foo/bar/",
|
||||
fallbackTitle: "example.com:8888/foo/bar/",
|
||||
heuristic: true,
|
||||
}),
|
||||
makeVisitResult(context, {
|
||||
@@ -130,7 +127,6 @@ add_task(async function port() {
|
||||
context,
|
||||
autofilled: "example.com:8888/foo/bar/baz",
|
||||
completed: "http://example.com:8888/foo/bar/baz",
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "http://example.com:8888/foo/bar/baz",
|
||||
@@ -235,7 +231,6 @@ add_task(async function uriFragmentCaseSensitive() {
|
||||
context,
|
||||
autofilled: "http://example.com/#TEST",
|
||||
completed: "http://example.com/#TEST",
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
source: UrlbarUtils.RESULT_SOURCE.HISTORY,
|
||||
@@ -262,12 +257,11 @@ add_task(async function uriCase() {
|
||||
expected: {
|
||||
autofilled: "example.COM/",
|
||||
completed: "http://example.com/",
|
||||
hasAutofillTitle: false,
|
||||
results: [
|
||||
context =>
|
||||
makeVisitResult(context, {
|
||||
uri: "http://example.com/",
|
||||
title: "example.com",
|
||||
fallbackTitle: "example.com",
|
||||
heuristic: true,
|
||||
}),
|
||||
context =>
|
||||
@@ -283,12 +277,11 @@ add_task(async function uriCase() {
|
||||
expected: {
|
||||
autofilled: "example.COM/",
|
||||
completed: "http://example.com/",
|
||||
hasAutofillTitle: false,
|
||||
results: [
|
||||
context =>
|
||||
makeVisitResult(context, {
|
||||
uri: "http://example.com/",
|
||||
title: "example.com/",
|
||||
fallbackTitle: "example.com/",
|
||||
heuristic: true,
|
||||
}),
|
||||
context =>
|
||||
@@ -304,12 +297,11 @@ add_task(async function uriCase() {
|
||||
expected: {
|
||||
autofilled: "example.COM/aBC/",
|
||||
completed: "http://example.com/ABC/",
|
||||
hasAutofillTitle: false,
|
||||
results: [
|
||||
context =>
|
||||
makeVisitResult(context, {
|
||||
uri: "http://example.com/ABC/",
|
||||
title: "example.com/ABC/",
|
||||
fallbackTitle: "example.com/ABC/",
|
||||
heuristic: true,
|
||||
}),
|
||||
context =>
|
||||
@@ -325,12 +317,11 @@ add_task(async function uriCase() {
|
||||
expected: {
|
||||
autofilled: "example.com/abC/",
|
||||
completed: "http://example.com/ABC/",
|
||||
hasAutofillTitle: false,
|
||||
results: [
|
||||
context =>
|
||||
makeVisitResult(context, {
|
||||
uri: "http://example.com/ABC/",
|
||||
title: "example.com/ABC/",
|
||||
fallbackTitle: "example.com/ABC/",
|
||||
heuristic: true,
|
||||
}),
|
||||
context =>
|
||||
@@ -346,12 +337,11 @@ add_task(async function uriCase() {
|
||||
expected: {
|
||||
autofilled: "example.com/abc/",
|
||||
completed: "http://example.com/ABC/",
|
||||
hasAutofillTitle: false,
|
||||
results: [
|
||||
context =>
|
||||
makeVisitResult(context, {
|
||||
uri: "http://example.com/ABC/",
|
||||
title: "example.com/ABC/",
|
||||
fallbackTitle: "example.com/ABC/",
|
||||
heuristic: true,
|
||||
}),
|
||||
context =>
|
||||
@@ -367,12 +357,11 @@ add_task(async function uriCase() {
|
||||
expected: {
|
||||
autofilled: "example.com/abc/",
|
||||
completed: "http://example.com/abc/",
|
||||
hasAutofillTitle: false,
|
||||
results: [
|
||||
context =>
|
||||
makeVisitResult(context, {
|
||||
uri: "http://example.com/abc/",
|
||||
title: "example.com/abc/",
|
||||
fallbackTitle: "example.com/abc/",
|
||||
heuristic: true,
|
||||
}),
|
||||
context =>
|
||||
@@ -388,7 +377,6 @@ add_task(async function uriCase() {
|
||||
expected: {
|
||||
autofilled: "example.com/abc/dEF",
|
||||
completed: "http://example.com/ABC/DEF",
|
||||
hasAutofillTitle: true,
|
||||
results: [
|
||||
context =>
|
||||
makeVisitResult(context, {
|
||||
@@ -404,7 +392,6 @@ add_task(async function uriCase() {
|
||||
expected: {
|
||||
autofilled: "example.com/abc/deF",
|
||||
completed: "http://example.com/ABC/DEF",
|
||||
hasAutofillTitle: true,
|
||||
results: [
|
||||
context =>
|
||||
makeVisitResult(context, {
|
||||
@@ -420,12 +407,11 @@ add_task(async function uriCase() {
|
||||
expected: {
|
||||
autofilled: "example.com/abc/def",
|
||||
completed: "http://example.com/abc/def",
|
||||
hasAutofillTitle: false,
|
||||
results: [
|
||||
context =>
|
||||
makeVisitResult(context, {
|
||||
uri: "http://example.com/abc/def",
|
||||
title: "example.com/abc/def",
|
||||
fallbackTitle: "example.com/abc/def",
|
||||
heuristic: true,
|
||||
}),
|
||||
context =>
|
||||
@@ -441,12 +427,11 @@ add_task(async function uriCase() {
|
||||
expected: {
|
||||
autofilled: "http://example.com/aBC/",
|
||||
completed: "http://example.com/ABC/",
|
||||
hasAutofillTitle: false,
|
||||
results: [
|
||||
context =>
|
||||
makeVisitResult(context, {
|
||||
uri: "http://example.com/ABC/",
|
||||
title: "example.com/ABC/",
|
||||
fallbackTitle: "example.com/ABC/",
|
||||
heuristic: true,
|
||||
}),
|
||||
context =>
|
||||
@@ -462,12 +447,11 @@ add_task(async function uriCase() {
|
||||
expected: {
|
||||
autofilled: "http://example.com/abc/",
|
||||
completed: "http://example.com/abc/",
|
||||
hasAutofillTitle: false,
|
||||
results: [
|
||||
context =>
|
||||
makeVisitResult(context, {
|
||||
uri: "http://example.com/abc/",
|
||||
title: "example.com/abc/",
|
||||
fallbackTitle: "example.com/abc/",
|
||||
heuristic: true,
|
||||
}),
|
||||
context =>
|
||||
@@ -483,7 +467,6 @@ add_task(async function uriCase() {
|
||||
expected: {
|
||||
autofilled: "http://example.com/abc/dEF",
|
||||
completed: "http://example.com/ABC/DEF",
|
||||
hasAutofillTitle: true,
|
||||
results: [
|
||||
context =>
|
||||
makeVisitResult(context, {
|
||||
@@ -499,12 +482,11 @@ add_task(async function uriCase() {
|
||||
expected: {
|
||||
autofilled: "http://example.com/abc/def",
|
||||
completed: "http://example.com/abc/def",
|
||||
hasAutofillTitle: false,
|
||||
results: [
|
||||
context =>
|
||||
makeVisitResult(context, {
|
||||
uri: "http://example.com/abc/def",
|
||||
title: "example.com/abc/def",
|
||||
fallbackTitle: "example.com/abc/def",
|
||||
heuristic: true,
|
||||
}),
|
||||
context =>
|
||||
@@ -520,7 +502,6 @@ add_task(async function uriCase() {
|
||||
expected: {
|
||||
autofilled: "http://eXAMple.com/ABC/DEF",
|
||||
completed: "http://example.com/ABC/DEF",
|
||||
hasAutofillTitle: true,
|
||||
results: [
|
||||
context =>
|
||||
makeVisitResult(context, {
|
||||
@@ -536,12 +517,11 @@ add_task(async function uriCase() {
|
||||
expected: {
|
||||
autofilled: "http://eXAMple.com/abc/def",
|
||||
completed: "http://example.com/abc/def",
|
||||
hasAutofillTitle: false,
|
||||
results: [
|
||||
context =>
|
||||
makeVisitResult(context, {
|
||||
uri: "http://example.com/abc/def",
|
||||
title: "example.com/abc/def",
|
||||
fallbackTitle: "example.com/abc/def",
|
||||
heuristic: true,
|
||||
}),
|
||||
context =>
|
||||
@@ -562,7 +542,6 @@ add_task(async function uriCase() {
|
||||
context,
|
||||
autofilled: expected.autofilled,
|
||||
completed: expected.completed,
|
||||
hasAutofillTitle: expected.hasAutofillTitle,
|
||||
matches: expected.results.map(f => f(context)),
|
||||
});
|
||||
}
|
||||
@@ -591,7 +570,6 @@ async function testCaseInsensitive(isBookmark = false) {
|
||||
context,
|
||||
autofilled: expectedAutofill,
|
||||
completed: "http://example.com/foo",
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "http://example.com/foo",
|
||||
@@ -620,7 +598,6 @@ add_task(async function originLooksLikePrefix1() {
|
||||
context,
|
||||
autofilled: "localhost:8888/foo",
|
||||
completed: "http://localhost:8888/foo",
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "http://localhost:8888/foo",
|
||||
@@ -646,11 +623,10 @@ add_task(async function originLooksLikePrefix2() {
|
||||
context,
|
||||
autofilled: "localhost:8888/foo/",
|
||||
completed: "http://localhost:8888/foo/",
|
||||
hasAutofillTitle: false,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "http://localhost:8888/foo/",
|
||||
title: "localhost:8888/foo/",
|
||||
fallbackTitle: "localhost:8888/foo/",
|
||||
heuristic: true,
|
||||
}),
|
||||
makeVisitResult(context, {
|
||||
@@ -667,7 +643,6 @@ add_task(async function originLooksLikePrefix2() {
|
||||
context,
|
||||
autofilled: "localhost:8888/foo/bar",
|
||||
completed: "http://localhost:8888/foo/bar",
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "http://localhost:8888/foo/bar",
|
||||
@@ -714,7 +689,6 @@ add_task(async function viewSourceAsPrefix() {
|
||||
context,
|
||||
completed,
|
||||
autofilled,
|
||||
hasAutofillTitle: false,
|
||||
matches: [
|
||||
{
|
||||
heuristic: true,
|
||||
@@ -767,7 +741,6 @@ add_task(async function dataAsPrefix() {
|
||||
context,
|
||||
completed,
|
||||
autofilled,
|
||||
hasAutofillTitle: false,
|
||||
matches: [
|
||||
{
|
||||
heuristic: true,
|
||||
@@ -829,7 +802,6 @@ add_task(async function wwwHistory() {
|
||||
expected: {
|
||||
autofilled: "example.com/",
|
||||
completed: "http://www.example.com/",
|
||||
hasAutofillTitle: true,
|
||||
results: [
|
||||
context =>
|
||||
makeVisitResult(context, {
|
||||
@@ -846,7 +818,6 @@ add_task(async function wwwHistory() {
|
||||
expected: {
|
||||
autofilled: "https://example.com/",
|
||||
completed: "https://www.example.com/",
|
||||
hasAutofillTitle: true,
|
||||
results: [
|
||||
context =>
|
||||
makeVisitResult(context, {
|
||||
@@ -863,7 +834,6 @@ add_task(async function wwwHistory() {
|
||||
expected: {
|
||||
autofilled: "https://example.com/abc",
|
||||
completed: "https://www.example.com/abc",
|
||||
hasAutofillTitle: true,
|
||||
results: [
|
||||
context =>
|
||||
makeVisitResult(context, {
|
||||
@@ -880,12 +850,11 @@ add_task(async function wwwHistory() {
|
||||
expected: {
|
||||
autofilled: "https://example.com/ABC",
|
||||
completed: "https://www.example.com/ABC",
|
||||
hasAutofillTitle: false,
|
||||
results: [
|
||||
context =>
|
||||
makeVisitResult(context, {
|
||||
uri: "https://www.example.com/ABC",
|
||||
title: "https://www.example.com/ABC",
|
||||
fallbackTitle: "https://www.example.com/ABC",
|
||||
heuristic: true,
|
||||
}),
|
||||
context =>
|
||||
@@ -905,7 +874,6 @@ add_task(async function wwwHistory() {
|
||||
context,
|
||||
completed: expected.completed,
|
||||
autofilled: expected.autofilled,
|
||||
hasAutofillTitle: expected.hasAutofillTitle,
|
||||
matches: expected.results.map(f => f(context)),
|
||||
});
|
||||
await cleanupPlaces();
|
||||
|
||||
@@ -252,11 +252,10 @@ add_task(async function test_prefix_autofill() {
|
||||
incompleteSearch: "moz",
|
||||
autofilled: "mozilla.org/",
|
||||
completed: "http://mozilla.org/",
|
||||
hasAutofillTitle: false,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "http://mozilla.org/",
|
||||
title: "mozilla.org",
|
||||
fallbackTitle: "mozilla.org",
|
||||
heuristic: true,
|
||||
}),
|
||||
makeVisitResult(context, {
|
||||
|
||||
@@ -26,11 +26,10 @@ add_task(async function test_protocol_trimming() {
|
||||
context,
|
||||
autofilled: prot + "://www.mozilla.org/",
|
||||
completed: prot + "://www.mozilla.org/",
|
||||
hasAutofillTitle: false,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: prot + "://www.mozilla.org/",
|
||||
title:
|
||||
fallbackTitle:
|
||||
prot == "http" ? "www.mozilla.org" : prot + "://www.mozilla.org",
|
||||
heuristic: true,
|
||||
}),
|
||||
@@ -48,11 +47,10 @@ add_task(async function test_protocol_trimming() {
|
||||
context,
|
||||
autofilled: "www.mozilla.org/",
|
||||
completed: prot + "://www.mozilla.org/",
|
||||
hasAutofillTitle: false,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: prot + "://www.mozilla.org/",
|
||||
title:
|
||||
fallbackTitle:
|
||||
prot == "http" ? "www.mozilla.org" : prot + "://www.mozilla.org",
|
||||
heuristic: true,
|
||||
}),
|
||||
|
||||
@@ -17,11 +17,10 @@ add_task(async function test_casing_1() {
|
||||
context,
|
||||
autofilled: "MOZilla.org/",
|
||||
completed: "http://mozilla.org/",
|
||||
hasAutofillTitle: false,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "http://mozilla.org/",
|
||||
title: "mozilla.org",
|
||||
fallbackTitle: "mozilla.org",
|
||||
heuristic: true,
|
||||
}),
|
||||
makeVisitResult(context, {
|
||||
@@ -44,7 +43,6 @@ add_task(async function test_casing_2() {
|
||||
context,
|
||||
autofilled: "mozilla.org/Test/",
|
||||
completed: "http://mozilla.org/test/",
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
source: UrlbarUtils.RESULT_SOURCE.HISTORY,
|
||||
@@ -69,7 +67,6 @@ add_task(async function test_casing_3() {
|
||||
context,
|
||||
autofilled: "mozilla.org/Test/",
|
||||
completed: "http://mozilla.org/Test/",
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "http://mozilla.org/Test/",
|
||||
@@ -91,7 +88,6 @@ add_task(async function test_casing_4() {
|
||||
context,
|
||||
autofilled: "mOzilla.org/test/",
|
||||
completed: "http://mozilla.org/Test/",
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
source: UrlbarUtils.RESULT_SOURCE.HISTORY,
|
||||
@@ -116,7 +112,6 @@ add_task(async function test_casing_5() {
|
||||
context,
|
||||
autofilled: "mOzilla.org/Test/",
|
||||
completed: "http://mozilla.org/Test/",
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "http://mozilla.org/Test/",
|
||||
@@ -138,11 +133,10 @@ add_task(async function test_untrimmed_casing() {
|
||||
context,
|
||||
autofilled: "http://mOzilla.org/",
|
||||
completed: "http://mozilla.org/",
|
||||
hasAutofillTitle: false,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "http://mozilla.org/",
|
||||
title: "mozilla.org",
|
||||
fallbackTitle: "mozilla.org",
|
||||
heuristic: true,
|
||||
}),
|
||||
makeVisitResult(context, {
|
||||
@@ -165,11 +159,10 @@ add_task(async function test_untrimmed_www_casing() {
|
||||
context,
|
||||
autofilled: "http://www.mOzilla.org/",
|
||||
completed: "http://www.mozilla.org/",
|
||||
hasAutofillTitle: false,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "http://www.mozilla.org/",
|
||||
title: "www.mozilla.org",
|
||||
fallbackTitle: "www.mozilla.org",
|
||||
heuristic: true,
|
||||
}),
|
||||
makeVisitResult(context, {
|
||||
@@ -192,7 +185,6 @@ add_task(async function test_untrimmed_path_casing() {
|
||||
context,
|
||||
autofilled: "http://mOzilla.org/test/",
|
||||
completed: "http://mozilla.org/Test/",
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
source: UrlbarUtils.RESULT_SOURCE.HISTORY,
|
||||
@@ -217,7 +209,6 @@ add_task(async function test_untrimmed_path_casing_2() {
|
||||
context,
|
||||
autofilled: "http://mOzilla.org/Test/",
|
||||
completed: "http://mozilla.org/Test/",
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "http://mozilla.org/Test/",
|
||||
@@ -239,7 +230,6 @@ add_task(async function test_untrimmed_path_www_casing() {
|
||||
context,
|
||||
autofilled: "http://www.mOzilla.org/test/",
|
||||
completed: "http://www.mozilla.org/Test/",
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
source: UrlbarUtils.RESULT_SOURCE.HISTORY,
|
||||
@@ -264,7 +254,6 @@ add_task(async function test_untrimmed_path_www_casing_2() {
|
||||
context,
|
||||
autofilled: "http://www.mOzilla.org/Test/",
|
||||
completed: "http://www.mozilla.org/Test/",
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "http://www.mozilla.org/Test/",
|
||||
|
||||
@@ -48,7 +48,6 @@ add_task(async function dedupe_prefix() {
|
||||
context,
|
||||
autofilled: "example.com/foo/",
|
||||
completed: "https://www.example.com/foo/",
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "https://www.example.com/foo/",
|
||||
@@ -86,7 +85,6 @@ add_task(async function dedupe_prefix() {
|
||||
context,
|
||||
autofilled: "example.com/foo/",
|
||||
completed: "http://www.example.com/foo/",
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "http://www.example.com/foo/",
|
||||
@@ -128,7 +126,6 @@ add_task(async function dedupe_prefix() {
|
||||
context,
|
||||
autofilled: "example.com/foo/",
|
||||
completed: "https://example.com/foo/",
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "https://example.com/foo/",
|
||||
@@ -188,7 +185,6 @@ add_task(async function hideHeuristic() {
|
||||
context,
|
||||
autofilled: "example.com/foo/",
|
||||
completed: "https://www.example.com/foo/",
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "https://www.example.com/foo/",
|
||||
@@ -226,7 +222,6 @@ add_task(async function hideHeuristic() {
|
||||
context,
|
||||
autofilled: "example.com/foo/",
|
||||
completed: "http://www.example.com/foo/",
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "http://www.example.com/foo/",
|
||||
@@ -264,7 +259,6 @@ add_task(async function hideHeuristic() {
|
||||
context,
|
||||
autofilled: "example.com/foo/",
|
||||
completed: "https://example.com/foo/",
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "https://example.com/foo/",
|
||||
|
||||
@@ -10,7 +10,6 @@ add_task(async function test_encoded() {
|
||||
context,
|
||||
autofilled: url,
|
||||
completed: url,
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: url,
|
||||
@@ -36,7 +35,6 @@ add_task(async function test_encoded_trimmed() {
|
||||
context,
|
||||
autofilled: "mozilla.com/search/top/?q=%25%32%35",
|
||||
completed: url,
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: url,
|
||||
@@ -62,7 +60,6 @@ add_task(async function test_encoded_partial() {
|
||||
context,
|
||||
autofilled: url,
|
||||
completed: url,
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: url,
|
||||
@@ -88,7 +85,6 @@ add_task(async function test_encoded_path() {
|
||||
context,
|
||||
autofilled: url,
|
||||
completed: url,
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: url,
|
||||
|
||||
@@ -17,11 +17,10 @@ add_task(async function test_non_keyword() {
|
||||
context,
|
||||
autofilled: "mozilla.org/",
|
||||
completed: "http://mozilla.org/",
|
||||
hasAutofillTitle: false,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "http://mozilla.org/",
|
||||
title: "mozilla.org",
|
||||
fallbackTitle: "mozilla.org",
|
||||
heuristic: true,
|
||||
}),
|
||||
makeBookmarkResult(context, {
|
||||
@@ -71,11 +70,10 @@ add_task(async function test_more_than_keyword() {
|
||||
context,
|
||||
autofilled: "mozilla.org/",
|
||||
completed: "http://mozilla.org/",
|
||||
hasAutofillTitle: false,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "http://mozilla.org/",
|
||||
title: "mozilla.org",
|
||||
fallbackTitle: "mozilla.org",
|
||||
heuristic: true,
|
||||
}),
|
||||
makeBookmarkResult(context, {
|
||||
@@ -102,11 +100,10 @@ add_task(async function test_less_than_keyword() {
|
||||
search: "mo",
|
||||
autofilled: "mozilla.org/",
|
||||
completed: "http://mozilla.org/",
|
||||
hasAutofillTitle: false,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "http://mozilla.org/",
|
||||
title: "mozilla.org",
|
||||
fallbackTitle: "mozilla.org",
|
||||
heuristic: true,
|
||||
}),
|
||||
makeBookmarkResult(context, {
|
||||
@@ -159,7 +156,6 @@ add_task(async function test_less_then_equal_than_keyword_bug_1124238() {
|
||||
search: "mo",
|
||||
autofilled: "mozilla.com/",
|
||||
completed: "http://mozilla.com/",
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "http://mozilla.com/",
|
||||
@@ -199,7 +195,6 @@ add_task(async function test_less_then_equal_than_keyword_bug_1124238() {
|
||||
context,
|
||||
autofilled: "mozilla.com/",
|
||||
completed: "http://mozilla.com/",
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "http://mozilla.com/",
|
||||
|
||||
@@ -39,7 +39,6 @@ add_task(async function basic() {
|
||||
context,
|
||||
autofilled: "example.com/",
|
||||
completed: "https://example.com/",
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "https://example.com/",
|
||||
@@ -66,7 +65,6 @@ add_task(async function basic() {
|
||||
context,
|
||||
autofilled: "example.com/",
|
||||
completed: "https://example.com/",
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "https://example.com/",
|
||||
@@ -118,7 +116,6 @@ add_task(async function autofillDoesNotMatchEngine() {
|
||||
context,
|
||||
autofilled: "example.test.ca/",
|
||||
completed: "https://example.test.ca/",
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "https://example.test.ca/",
|
||||
@@ -142,7 +139,6 @@ add_task(async function ignoreWww() {
|
||||
context,
|
||||
autofilled: "www.example.com/",
|
||||
completed: "https://www.example.com/",
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "https://www.example.com/",
|
||||
@@ -179,7 +175,6 @@ add_task(async function ignoreWww() {
|
||||
context,
|
||||
autofilled: "foo.bar/",
|
||||
completed: "https://foo.bar/",
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "https://foo.bar/",
|
||||
@@ -208,7 +203,6 @@ add_task(async function ignoreWww() {
|
||||
context,
|
||||
autofilled: "foo.bar/",
|
||||
completed: "https://www.foo.bar/",
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "https://www.foo.bar/",
|
||||
@@ -268,7 +262,6 @@ add_task(async function conflictingEngines() {
|
||||
context,
|
||||
autofilled: "foo.com/",
|
||||
completed: "https://foo.com/",
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "https://foo.com/",
|
||||
@@ -301,7 +294,6 @@ add_task(async function conflictingEngines() {
|
||||
context,
|
||||
autofilled: "foobar.com/",
|
||||
completed: "https://foobar.com/",
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "https://foobar.com/",
|
||||
@@ -365,7 +357,6 @@ add_task(async function multipleEnginesForHostname() {
|
||||
context,
|
||||
autofilled: "example.com/",
|
||||
completed: "https://example.com/",
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "https://example.com/",
|
||||
@@ -403,7 +394,6 @@ add_task(async function test_casing() {
|
||||
context,
|
||||
autofilled: "eXAmple.com/",
|
||||
completed: "https://example.com/",
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "https://example.com/",
|
||||
@@ -484,7 +474,6 @@ add_task(async function test_publicSuffixIsHost() {
|
||||
context,
|
||||
autofilled: "com.mx/",
|
||||
completed: "https://com.mx/",
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "https://com.mx/",
|
||||
@@ -516,7 +505,6 @@ add_task(async function test_disabledEngine() {
|
||||
context,
|
||||
autofilled: "disabled.com/",
|
||||
completed: "https://disabled.com/",
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "https://disabled.com/",
|
||||
@@ -541,7 +529,6 @@ add_task(async function test_disabledEngine() {
|
||||
context,
|
||||
autofilled: "disabled.com/",
|
||||
completed: "https://disabled.com/",
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "https://disabled.com/",
|
||||
|
||||
@@ -181,7 +181,6 @@ add_task(async function test() {
|
||||
context,
|
||||
autofilled: "www.example.com/",
|
||||
completed: "https://www.example.com/",
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: `${wwwUrl}/`,
|
||||
|
||||
@@ -17,11 +17,10 @@ add_task(async function test_no_slash() {
|
||||
context,
|
||||
autofilled: "file.org/",
|
||||
completed: "http://file.org/",
|
||||
hasAutofillTitle: false,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "http://file.org/",
|
||||
title: "file.org",
|
||||
fallbackTitle: "file.org",
|
||||
heuristic: true,
|
||||
}),
|
||||
makeVisitResult(context, {
|
||||
@@ -55,11 +54,10 @@ add_task(async function test_w_slash() {
|
||||
context,
|
||||
autofilled: "file.org/",
|
||||
completed: "http://file.org/",
|
||||
hasAutofillTitle: false,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "http://file.org/",
|
||||
title: "file.org/",
|
||||
fallbackTitle: "file.org/",
|
||||
heuristic: true,
|
||||
}),
|
||||
makeVisitResult(context, {
|
||||
@@ -87,7 +85,6 @@ add_task(async function test_middle() {
|
||||
context,
|
||||
autofilled: "file.org/test/",
|
||||
completed: "http://file.org/test/",
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "http://file.org/test/",
|
||||
|
||||
@@ -66,12 +66,11 @@ add_task(async function test_searchEngine_noautoFill() {
|
||||
context,
|
||||
autofilled: "my.search.com/",
|
||||
completed: "http://my.search.com/",
|
||||
hasAutofillTitle: false,
|
||||
matches: [
|
||||
// Note this result is a normal Autofill result and not a priority engine.
|
||||
makeVisitResult(context, {
|
||||
uri: "http://my.search.com/",
|
||||
title: "my.search.com",
|
||||
fallbackTitle: "my.search.com",
|
||||
heuristic: true,
|
||||
}),
|
||||
makeSearchResult(context, {
|
||||
|
||||
@@ -19,11 +19,10 @@ add_task(async function test_untrimmed_secure_www() {
|
||||
context,
|
||||
autofilled: "mozilla.org/",
|
||||
completed: "https://www.mozilla.org/",
|
||||
hasAutofillTitle: false,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "https://www.mozilla.org/",
|
||||
title: "https://www.mozilla.org",
|
||||
fallbackTitle: "https://www.mozilla.org",
|
||||
heuristic: true,
|
||||
}),
|
||||
makeVisitResult(context, {
|
||||
@@ -45,7 +44,6 @@ add_task(async function test_untrimmed_secure_www_path() {
|
||||
context,
|
||||
autofilled: "mozilla.org/test/",
|
||||
completed: "https://www.mozilla.org/test/",
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "https://www.mozilla.org/test/",
|
||||
@@ -67,11 +65,10 @@ add_task(async function test_untrimmed_secure() {
|
||||
context,
|
||||
autofilled: "mozilla.org/",
|
||||
completed: "https://mozilla.org/",
|
||||
hasAutofillTitle: false,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "https://mozilla.org/",
|
||||
title: "https://mozilla.org",
|
||||
fallbackTitle: "https://mozilla.org",
|
||||
heuristic: true,
|
||||
}),
|
||||
makeVisitResult(context, {
|
||||
@@ -93,7 +90,6 @@ add_task(async function test_untrimmed_secure_path() {
|
||||
context,
|
||||
autofilled: "mozilla.org/test/",
|
||||
completed: "https://mozilla.org/test/",
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "https://mozilla.org/test/",
|
||||
@@ -115,11 +111,10 @@ add_task(async function test_untrimmed_www() {
|
||||
context,
|
||||
autofilled: "mozilla.org/",
|
||||
completed: "http://www.mozilla.org/",
|
||||
hasAutofillTitle: false,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "http://www.mozilla.org/",
|
||||
title: "www.mozilla.org",
|
||||
fallbackTitle: "www.mozilla.org",
|
||||
heuristic: true,
|
||||
}),
|
||||
makeVisitResult(context, {
|
||||
@@ -141,7 +136,6 @@ add_task(async function test_untrimmed_www_path() {
|
||||
context,
|
||||
autofilled: "mozilla.org/test/",
|
||||
completed: "http://www.mozilla.org/test/",
|
||||
hasAutofillTitle: true,
|
||||
matches: [
|
||||
makeVisitResult(context, {
|
||||
uri: "http://www.mozilla.org/test/",
|
||||
|
||||
Reference in New Issue
Block a user