From 40a355a42d4a9444dc753c04c6608dade2f06a23 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 03:13:27 +0200 Subject: Adding upstream version 125.0.1. Signed-off-by: Daniel Baumann --- accessible/tests/browser/mac/browser_app.js | 38 +++++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) (limited to 'accessible/tests/browser/mac/browser_app.js') diff --git a/accessible/tests/browser/mac/browser_app.js b/accessible/tests/browser/mac/browser_app.js index bedefae440..e7e18b5ddd 100644 --- a/accessible/tests/browser/mac/browser_app.js +++ b/accessible/tests/browser/mac/browser_app.js @@ -138,7 +138,7 @@ add_task(async () => { gBrowser, url: "about:license", }, - async browser => { + async () => { let root = await getMacAccessible(document); let rootChildCount = () => root.getAttributeValue("AXChildren").length; @@ -206,8 +206,10 @@ add_task(async () => { is(rootChildCount(), baseRootChildCount + 1, "Root has another child"); // Close popup + let hide = waitForMacEvent("AXUIElementDestroyed"); EventUtils.synthesizeKey("KEY_Escape"); await BrowserTestUtils.waitForPopupEvent(identityPopup, "hidden"); + await hide; // We're back to the base child count is(rootChildCount(), baseRootChildCount, "Root has the base child count"); @@ -225,7 +227,7 @@ add_task(async () => { // eslint-disable-next-line @microsoft/sdl/no-insecure-url url: "http://example.com", }, - async browser => { + async () => { let input = await getMacAccessible("urlbar-input"); is( input.getAttributeValue("AXValue"), @@ -237,6 +239,38 @@ add_task(async () => { ); }); +/** + * Tests attributed text in nav bar has no invisible AXAttachments + */ +add_task(async () => { + await BrowserTestUtils.withNewTab( + { + gBrowser, + // eslint-disable-next-line @microsoft/sdl/no-insecure-url + url: "http://example.com", + }, + async () => { + let root = await getMacAccessible(document); + let navBar = await getMacAccessible("nav-bar"); + let elemRange = root.getParameterizedAttributeValue( + "AXTextMarkerRangeForUIElement", + navBar + ); + let attributedString = root.getParameterizedAttributeValue( + "AXAttributedStringForTextMarkerRange", + elemRange + ); + let attachmentRoles = attributedString.map(s => + s.AXAttachment ? s.AXAttachment.getAttributeValue("AXRole") : null + ); + ok( + !attachmentRoles.includes("AXMenu"), + "Collapsed menu should be embedded in attributed text" + ); + } + ); +}); + /** * Test context menu */ -- cgit v1.2.3