Skip to content

[macos] Provide public API to enable accessibility for a Flutter view #90673

@stuartmorgan-g

Description

@stuartmorgan-g

Currently the accessibility system is only enabled for macOS if VoiceOver is enabled. XCUITests are based on the accessibility tree, however, which means that there are use cases for explicitly enabling it.

Example STR:

  • Make a macOS plugin that uses some native UI (e.g., file_selector)
  • Try to write XCUITests for its example app, since Flutter integration tests won't work (due to modal native UI, which Flutter tests can't drive)
  • Neither recording nor running the test works, unless VoiceOver is on.

What I'd like to do is just force-enable accessibility in the example app. I don't care if performance suffers slightly in that case, since it's just for testing. (Alternately, if there's a way that we can detect that it's running in this case and enable it automatically, like we do for VO, that would work.)

/cc @chunhtai This is follow-up from recent Discord discussion; I've now verified that just running an XCUITest doesn't trigger the necessary system calls to enable it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: desktopRunning on desktopengineflutter/engine related. See also e: labels.platform-macBuilding on or for macOS specificallyteam-macosOwned by the macOS platform teamtriaged-macosTriaged by the macOS platform team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions