Bug 1690924: Wait for focus event instead of selected children changed r=eeejay

Differential Revision: https://phabricator.services.mozilla.com/D104264
This commit is contained in:
Morgan Reschenberg 2021-02-09 17:57:04 +00:00
Родитель 1380021cac
Коммит f4a86a8e84
1 изменённых файлов: 13 добавлений и 1 удалений

Просмотреть файл

@ -74,9 +74,21 @@ addAccessibleTask(
"First menu item is selected"
);
// focus the second item, and verify it is selected
event = waitForMacEvent("AXFocusedUIElementChanged");
event = waitForMacEvent("AXFocusedUIElementChanged", (iface, data) => {
try {
return iface.getAttributeValue("AXTitle") == "100%";
} catch (e) {
return false;
}
});
EventUtils.synthesizeKey("KEY_ArrowDown");
await event;
is(
children[0].getAttributeValue("AXSelected"),
0,
"First menu item is no longer selected"
);
is(
children[1].getAttributeValue("AXSelected"),
1,