diff options
Diffstat (limited to 'accessible/tests/browser/mac/browser_app.js')
-rw-r--r-- | accessible/tests/browser/mac/browser_app.js | 38 |
1 files changed, 36 insertions, 2 deletions
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"), @@ -238,6 +240,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 */ add_task(async () => { |