mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-20 00:35:44 +00:00
Bug 1481319 - Include prefix when matching bookmark keywords. r=mak
Differential Revision: https://phabricator.services.mozilla.com/D2804 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
168027fec9
commit
bb9689b710
@ -1531,7 +1531,7 @@ Search.prototype = {
|
||||
|
||||
async _matchPlacesKeyword() {
|
||||
// The first word could be a keyword, so that's what we'll search.
|
||||
let keyword = this._searchTokens[0];
|
||||
let keyword = this._strippedPrefix + this._searchTokens[0];
|
||||
let entry = await PlacesUtils.keywords.fetch(keyword);
|
||||
if (!entry)
|
||||
return false;
|
||||
|
@ -19,7 +19,7 @@ add_task(async function test_keyword_searc() {
|
||||
await PlacesTestUtils.addVisits([
|
||||
{ uri: uri1, title: "Generic page title" },
|
||||
{ uri: uri2, title: "Generic page title" },
|
||||
{ uri: uri3, title: "This page shouldn't be suggested" },
|
||||
{ uri: uri3, title: "This page uri contains the keyword" },
|
||||
]);
|
||||
await addBookmark({ uri: uri1, title: "Bookmark title", keyword: "key"});
|
||||
|
||||
@ -94,5 +94,12 @@ add_task(async function test_keyword_searc() {
|
||||
matches: [ { uri: NetUtil.newURI("http://abc/?search=test"), title: "abc", style: ["keyword", "heuristic"] } ]
|
||||
});
|
||||
|
||||
info("Bug 1481319 - Keyword with a prefix in front");
|
||||
await check_autocomplete({
|
||||
search: "http://key",
|
||||
matches: [ { uri: uri3, title: "This page uri contains the keyword" } ],
|
||||
completed: "http://key",
|
||||
});
|
||||
|
||||
await cleanup();
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user