From bcdce3e0796e9bdcd94f73a548eaddcda00a16e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Qu=C3=A8ze?= Date: Wed, 12 Aug 2026 22:38:59 +0000 Subject: [PATCH] Bug 2062572 - Open the permission menulist before selecting an item in browser_popup_blocker_identity_block.js, r=permissions-reviewers,emz. Waiting for the popup to be open before interacting with its contents. Its contents are invisible to the accessibility APIs and not focusable before that, which is the intermittent "Node is not focusable via the accessibility API". Differential Revision: https://phabricator.services.mozilla.com/D318037 --- .../test/popups/browser_popup_blocker_identity_block.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/browser/base/content/test/popups/browser_popup_blocker_identity_block.js b/browser/base/content/test/popups/browser_popup_blocker_identity_block.js index d3a529a62543..b640501255e2 100644 --- a/browser/base/content/test/popups/browser_popup_blocker_identity_block.js +++ b/browser/base/content/test/popups/browser_popup_blocker_identity_block.js @@ -162,9 +162,9 @@ add_task(async function check_permission_state_change() { // Open identity popup and change permission state to allow. await openPermissionPopup(); let menulist = document.getElementById("permission-popup-menulist"); - menulist.menupopup.openPopup(); // Open the allow/block menu + // Open the allow/block menu and click the item. let menuitem = menulist.getElementsByTagName("menuitem")[0]; - menuitem.click(); + await BrowserTestUtils.selectMenulistItem(menuitem); await closePermissionPopup(); state = SitePermissions.getForPrincipal(PRINCIPAL, "popup", gBrowser).state; @@ -201,9 +201,9 @@ add_task(async function check_permission_state_change() { // Open identity popup and change permission state to block. await openPermissionPopup(); menulist = document.getElementById("permission-popup-menulist"); - menulist.menupopup.openPopup(); // Open the allow/block menu + // Open the allow/block menu and click the item. menuitem = menulist.getElementsByTagName("menuitem")[1]; - menuitem.click(); + await BrowserTestUtils.selectMenulistItem(menuitem); await closePermissionPopup(); // Clicking on the "Block" menuitem should remove the permission object(same behavior as UNKNOWN state).