Bug 1667639 - Make keyword at the start of the string take precedence over restrict symbols at the end of the string. r=mak
This patch modifies PlacesUtils to cache the keywords and adds functionality to find a keyword. The Tokenizer calls PlacesUtils to know if the first word is a keyword and if the first word is a keyword, then the rest of the search string will be treated as text and Tokenizer won't filter any other restrict symbols. Differential Revision: https://phabricator.services.mozilla.com/D198208
This commit is contained in:
@@ -1056,6 +1056,7 @@ add_task(async function test_onQueryCanceled() {
|
||||
incognitoOverride: "spanning",
|
||||
background() {
|
||||
browser.urlbar.onBehaviorRequested.addListener(query => {
|
||||
browser.test.sendMessage("onBehaviorRequested");
|
||||
return "active";
|
||||
}, "test");
|
||||
browser.urlbar.onQueryCanceled.addListener(query => {
|
||||
@@ -1079,6 +1080,9 @@ add_task(async function test_onQueryCanceled() {
|
||||
let controller = UrlbarTestUtils.newMockController();
|
||||
|
||||
let startPromise = controller.startQuery(context);
|
||||
// Ensure the query has started, before trying to cancel it, otherwise we
|
||||
// won't get a `canceled` notification, as there's nothing to cancel.
|
||||
await ext.awaitMessage("onBehaviorRequested");
|
||||
controller.cancelQuery();
|
||||
await startPromise;
|
||||
|
||||
@@ -1381,6 +1385,10 @@ add_task(async function test_privateBrowsing_allowed_onQueryCanceled() {
|
||||
let controller = UrlbarTestUtils.newMockController();
|
||||
|
||||
let startPromise = controller.startQuery(context);
|
||||
// Ensure the query has started, before trying to cancel it, otherwise we
|
||||
// won't get a `canceled` notification, as there's nothing to cancel.
|
||||
await ext.awaitMessage("onBehaviorRequested");
|
||||
|
||||
controller.cancelQuery();
|
||||
await startPromise;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user