Merged from branch deedra after conflict fixes.

This commit is contained in:
Storm Dragon committed 2026-10-19 22:52:05 -04:00
commit 2dfd5b200a
15 files changed
+494 -152

No files matched your search

+13 -6
View File
@@ -20,7 +20,7 @@ parser.add_argument("--build-dir", default="build")
parser.add_argument("--session", action="store_true")
parser.add_argument("--reader", choices=("cthulhu", "orca"))
parser.add_argument("--extension-endpoint", action="store_true")
parser.add_argument("--fixture", choices=("menu", "edit", "notepad", "list", "listbox", "delphi", "winforms", "controls", "scintilla", "goldwave", "bootstrapper"), default="menu")
parser.add_argument("--fixture", choices=("menu", "edit", "hooks", "notepad", "list", "listbox", "delphi", "winforms", "controls", "scintilla", "goldwave", "bootstrapper"), default="menu")
parser.add_argument("--notepadpp-exe", type=Path)
parser.add_argument("--goldwave-exe", type=Path)
parser.add_argument("--32-bit", dest="is32Bit", action="store_true")
@@ -28,8 +28,8 @@ parser.add_argument("--late-helper", action="store_true")
parser.add_argument("--restart-helper", action="store_true")
add_test_options(parser)
args = parser.parse_args()
if args.is32Bit and args.fixture not in ("menu", "edit", "winforms", "list", "listbox", "delphi", "controls", "bootstrapper"):
parser.error("32-bit checks currently require --fixture menu, edit, winforms, list, listbox, delphi, controls or bootstrapper")
if args.is32Bit and args.fixture not in ("menu", "edit", "hooks", "winforms", "list", "listbox", "delphi", "controls", "bootstrapper"):
parser.error("32-bit checks currently require --fixture menu, edit, hooks, winforms, list, listbox, delphi, controls or bootstrapper")
if (args.late_helper or args.restart_helper) and args.fixture not in ("edit", "winforms", "scintilla"):
parser.error("helper lifecycle checks require --fixture edit, winforms or scintilla")
if args.fixture == "scintilla" and (not args.notepadpp_exe or not args.notepadpp_exe.is_file()):
@@ -157,6 +157,9 @@ with wine_test_directory(prefix="wine-access-menus-") as temporary:
while GLib.MainContext.default().iteration(False):
pass
time.sleep(0.01)
if args.fixture == "hooks":
print("PASS: hooks follow only the foreground UI thread, detach and reattach")
sys.exit(0)
focused = None
for event in events:
if event[1] == "focus":
@@ -169,14 +172,18 @@ with wine_test_directory(prefix="wine-access-menus-") as temporary:
uiaEvents = [e for e in events if ":bootstrapper-uia:" in e[0]]
for event in uiaEvents:
print(event[1:9])
def has_toggle_state(event):
return bool({"checked", "not checked", "half checked"}.intersection(event[5].split(", ")))
# Focus can arrive before the native hook's state reply. It must
# then be followed by a known state for that same focused source.
# An unavailable flag alone does not include the Toggle value.
for index, event in enumerate(uiaEvents):
if event[3] == "check box" and not event[5]:
if event[3] == "check box" and not has_toggle_state(event):
assert event[1] == "focus", f"lost a previously known checkbox state: {event!r}"
assert index + 1 < len(uiaEvents) and uiaEvents[index + 1][0] == event[0] and uiaEvents[index + 1][5], \
assert index + 1 < len(uiaEvents) and uiaEvents[index + 1][0] == event[0] and has_toggle_state(uiaEvents[index + 1]), \
f"checkbox state never arrived after focus: {uiaEvents[index:]!r}"
knownEvents = [e for e in uiaEvents if e[3] != "check box" or e[5]]
knownEvents = [e for e in uiaEvents if e[3] != "check box" or has_toggle_state(e)]
assert [e[2:5] for e in knownEvents] == [
("Select a Language", "combo box", "English (United States)"),
("Select a Language", "combo box", "French"),