diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:35:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:35:29 +0000 |
commit | 59203c63bb777a3bacec32fb8830fba33540e809 (patch) | |
tree | 58298e711c0ff0575818c30485b44a2f21bf28a0 /browser/components/preferences/tests/browser_search_quickactions.js | |
parent | Adding upstream version 126.0.1. (diff) | |
download | firefox-59203c63bb777a3bacec32fb8830fba33540e809.tar.xz firefox-59203c63bb777a3bacec32fb8830fba33540e809.zip |
Adding upstream version 127.0.upstream/127.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'browser/components/preferences/tests/browser_search_quickactions.js')
-rw-r--r-- | browser/components/preferences/tests/browser_search_quickactions.js | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/browser/components/preferences/tests/browser_search_quickactions.js b/browser/components/preferences/tests/browser_search_quickactions.js index db938035ae..70799b5002 100644 --- a/browser/components/preferences/tests/browser_search_quickactions.js +++ b/browser/components/preferences/tests/browser_search_quickactions.js @@ -6,26 +6,26 @@ "use strict"; ChromeUtils.defineESModuleGetters(this, { - UrlbarProviderQuickActions: - "resource:///modules/UrlbarProviderQuickActions.sys.mjs", + ActionsProviderQuickActions: + "resource:///modules/ActionsProviderQuickActions.sys.mjs", UrlbarTestUtils: "resource://testing-common/UrlbarTestUtils.sys.mjs", }); add_setup(async function setup() { await SpecialPowers.pushPrefEnv({ set: [ - ["browser.urlbar.suggest.quickactions", true], + ["browser.urlbar.secondaryActions.featureGate", true], ["browser.urlbar.quickactions.enabled", true], ], }); - UrlbarProviderQuickActions.addAction("testaction", { + ActionsProviderQuickActions.addAction("testaction", { commands: ["testaction"], label: "quickactions-downloads2", }); registerCleanupFunction(() => { - UrlbarProviderQuickActions.removeAction("testaction"); + ActionsProviderQuickActions.removeAction("testaction"); }); }); @@ -61,15 +61,23 @@ add_task(async function test_show_prefs() { await BrowserTestUtils.removeTab(tab); }); -async function testActionIsShown(window) { +async function testActionIsShown(window, name) { await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, value: "testact", waitForFocus: SimpleTest.waitForFocus, }); try { - let { result } = await UrlbarTestUtils.getDetailsOfResultAt(window, 1); - return result.providerName == "quickactions"; + await BrowserTestUtils.waitForMutationCondition( + window.document, + {}, + () => + !!window.document.querySelector( + `.urlbarView-action-btn[data-action=${name}]` + ) + ); + Assert.ok(true, `We found action "${name}"`); + return true; } catch (e) { return false; } @@ -100,7 +108,7 @@ add_task(async function test_prefs() { }); Assert.ok( - await testActionIsShown(window), + await testActionIsShown(window, "testaction"), "Actions are shown after user clicks checkbox" ); |