зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1893823 - Contextual Search breaks urlbar when no engine is present. r=daisuke
Differential Revision: https://phabricator.services.mozilla.com/D208835
This commit is contained in:
Родитель
8c366161bb
Коммит
a904cc5aeb
|
@ -53,7 +53,7 @@ class ProviderContextualSearch extends ActionsProvider {
|
|||
}
|
||||
|
||||
let engine = await this.fetchEngine(controller);
|
||||
let icon = engine?.icon || (await engine.getIconURL?.());
|
||||
let icon = engine?.icon || (await engine?.getIconURL?.());
|
||||
let defaultEngine = lazy.UrlbarSearchUtils.getDefaultEngine();
|
||||
|
||||
if (
|
||||
|
|
|
@ -26,6 +26,30 @@ add_setup(async function setup() {
|
|||
await AddonTestUtils.waitForSearchProviderStartup(ext);
|
||||
});
|
||||
|
||||
add_task(async function test_no_engine() {
|
||||
const ENGINE_TEST_URL = "https://example.org/";
|
||||
let onLoaded = BrowserTestUtils.browserLoaded(
|
||||
gBrowser.selectedBrowser,
|
||||
false,
|
||||
ENGINE_TEST_URL
|
||||
);
|
||||
BrowserTestUtils.startLoadingURIString(
|
||||
gBrowser.selectedBrowser,
|
||||
ENGINE_TEST_URL
|
||||
);
|
||||
await onLoaded;
|
||||
|
||||
await UrlbarTestUtils.promiseAutocompleteResultPopup({
|
||||
window,
|
||||
value: "test",
|
||||
});
|
||||
|
||||
Assert.ok(
|
||||
UrlbarTestUtils.getResultCount(window) > 0,
|
||||
"At least one result is shown"
|
||||
);
|
||||
});
|
||||
|
||||
add_task(async function test_selectContextualSearchResult_already_installed() {
|
||||
const ENGINE_TEST_URL = "https://example.com/";
|
||||
let onLoaded = BrowserTestUtils.browserLoaded(
|
||||
|
|
Загрузка…
Ссылка в новой задаче