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
This commit is contained in:
Florian Quèze
2026-08-12 22:41:32 +00:00
committed by fqueze@mozilla.com
parent 5a104d2260
commit bcdce3e079
@@ -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).