Backed out changeset 6e615e9f5457 (bug 1938040) for causing xpcshell failures in test_providerOmnibox.js.
This commit is contained in:
@@ -19,6 +19,7 @@ ChromeUtils.defineESModuleGetters(lazy, {
|
||||
UrlbarPrefs: "resource:///modules/UrlbarPrefs.sys.mjs",
|
||||
UrlbarProviderAutofill: "resource:///modules/UrlbarProviderAutofill.sys.mjs",
|
||||
UrlbarSearchUtils: "resource:///modules/UrlbarSearchUtils.sys.mjs",
|
||||
UrlbarTokenizer: "resource:///modules/UrlbarTokenizer.sys.mjs",
|
||||
});
|
||||
|
||||
const ENABLED_PREF = "contextualSearch.enabled";
|
||||
@@ -54,6 +55,8 @@ class ProviderContextualSearch extends ActionsProvider {
|
||||
queryContext.trimmedSearchString &&
|
||||
lazy.UrlbarPrefs.getScotchBonnetPref(ENABLED_PREF) &&
|
||||
!queryContext.searchMode &&
|
||||
queryContext.tokens.length == 1 &&
|
||||
queryContext.tokens[0].type != lazy.UrlbarTokenizer.TYPE.URL &&
|
||||
lazy.UrlbarPrefs.get("suggest.engines")
|
||||
);
|
||||
}
|
||||
|
||||
@@ -205,41 +205,3 @@ add_task(async function enter_action_search_mode() {
|
||||
|
||||
BrowserTestUtils.removeTab(gBrowser.selectedTab);
|
||||
});
|
||||
|
||||
add_task(async function test_opensearch() {
|
||||
const TEST_DATA = [
|
||||
{
|
||||
query: "word",
|
||||
expectedUrl: "http://mochi.test:8888/?terms=word",
|
||||
},
|
||||
{
|
||||
query: "word1 word2",
|
||||
expectedUrl: "http://mochi.test:8888/?terms=word1+word2",
|
||||
},
|
||||
{
|
||||
query: "https://example.com/",
|
||||
expectedUrl: "http://mochi.test:8888/?terms=https%3A%2F%2Fexample.com%2F",
|
||||
},
|
||||
];
|
||||
for (let { query, expectedUrl } of TEST_DATA) {
|
||||
let url = getRootDirectory(gTestPath) + "add_search_engine_one.html";
|
||||
await BrowserTestUtils.withNewTab(url, async () => {
|
||||
await UrlbarTestUtils.promiseAutocompleteResultPopup({
|
||||
window,
|
||||
value: query,
|
||||
});
|
||||
let { result } = await UrlbarTestUtils.getRowAt(window, 1);
|
||||
Assert.equal(result.providerName, "UrlbarProviderGlobalActions");
|
||||
|
||||
let onLoad = BrowserTestUtils.browserLoaded(
|
||||
gBrowser.selectedBrowser,
|
||||
false,
|
||||
expectedUrl
|
||||
);
|
||||
EventUtils.synthesizeKey("KEY_Tab");
|
||||
EventUtils.synthesizeKey("KEY_Enter");
|
||||
await onLoad;
|
||||
Assert.ok(true, "Action for open search works expectedly");
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user