More accessibility fixes using foobar2000 as a test.

This commit is contained in:
Storm Dragon committed 2026-10-10 15:30:23 -04:00
1 parent 22f50402c4
commit 5f78168c57
9 files changed
+407 -14

No files matched your search

+27 -3
View File
@@ -16,13 +16,13 @@ from gi.repository import Gio, GLib
parser = argparse.ArgumentParser()
parser.add_argument("--build-dir", default="build")
parser.add_argument("--session", action="store_true")
parser.add_argument("--fixture", choices=("menu", "edit", "notepad", "list", "winforms"), default="menu")
parser.add_argument("--fixture", choices=("menu", "edit", "notepad", "list", "winforms", "controls"), default="menu")
parser.add_argument("--32-bit", dest="is32Bit", action="store_true")
parser.add_argument("--late-helper", action="store_true")
parser.add_argument("--restart-helper", action="store_true")
args = parser.parse_args()
if args.is32Bit and args.fixture != "list":
parser.error("32-bit checks currently require --fixture list")
if args.is32Bit and args.fixture not in ("list", "controls"):
parser.error("32-bit checks currently require --fixture list or controls")
if (args.late_helper or args.restart_helper) and args.fixture not in ("edit", "winforms"):
parser.error("helper lifecycle checks require --fixture edit or --fixture winforms")
build = Path(args.build_dir).resolve()
@@ -111,6 +111,30 @@ with tempfile.TemporaryDirectory(prefix="wine-access-menus-") as temporary:
focused = event[0]
elif event[1] == "text":
assert event[0] == focused, f"text sent without establishing focus: {event!r}"
if args.fixture == "controls":
for event in events:
print(event[1:9])
for caption in ("Albums & artists β", "Details", "Default Playlist", "Second Playlist"):
assert any(e[2] == caption and e[3] == "page tab" and e[7] in (1, 2)
and e[8] == 2 for e in events), f"native/ATL tab missing: {caption}"
assert any(e[2] == "All music" and e[3] == "tree item" and "collapsed" in e[5]
for e in events), "collapsed tree selection missing"
assert any(e[2] == "All music" and "expanded" in e[5] for e in events), "tree expansion missing"
assert any(e[2] == "Artist & album β" and e[3] == "tree item" for e in events), "tree navigation missing"
assert any(e[1] == "focus" and e[2] == "Named native button" and e[3] == "button"
for e in events), "named generic MSAA client hid button role"
for value in ("by artist", "by year"):
assert any(e[2] == "View" and e[3] == "combo box" and e[4] == value
for e in events), f"combo label/role/value missing: {value}"
if not args.is32Bit:
assert any(e[2] == "Filter" and e[3] == "edit" and e[4] == "search"
for e in events), "late native edit label missing"
assert any(e[2] == "" and e[3] == "page tab" and e[7:9] == (0, 0)
for e in events), "empty tabs retained stale caption"
assert any(e[2] == "" and e[3] == "tree" for e in events), "empty tree retained stale item"
assert not any(e[2] == "Tree1" for e in events), "generic tree name leaked"
print("PASS: native/ATL tabs, tree selection/states/return, named button, combo and edit labels, empty controls")
sys.exit(0)
if args.fixture == "list":
listEvents = [e for e in events if e[3] == "list"]
for event in listEvents: