Bug 1648813: Wait for AXLoadComplete on spawned tab based on label r=eeejay

Differential Revision: https://phabricator.services.mozilla.com/D104553
This commit is contained in:
Morgan Reschenberg 2021-02-10 18:29:02 +00:00
Родитель 269a6fbae9
Коммит 8a85843ede
1 изменённых файлов: 3 добавлений и 6 удалений

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

@ -9,7 +9,9 @@ loadScripts({ name: "role.js", dir: MOCHITESTS_DIR });
// Test web area role and AXLoadComplete event
addAccessibleTask(``, async (browser, accDoc) => {
let evt = waitForMacEvent("AXLoadComplete");
let evt = waitForMacEvent("AXLoadComplete", (iface, data) => {
return iface.getAttributeValue("AXDescription") == "webarea test";
});
await SpecialPowers.spawn(browser, [], () => {
content.location = "data:text/html,<title>webarea test</title>";
});
@ -22,11 +24,6 @@ addAccessibleTask(``, async (browser, accDoc) => {
);
is(doc.getAttributeValue("AXValue"), "", "document has no AXValue");
is(doc.getAttributeValue("AXTitle"), null, "document has no AXTitle");
is(
doc.getAttributeValue("AXDescription"),
"webarea test",
"test has correct label"
);
is(doc.getAttributeValue("AXLoaded"), 1, "document has finished loading");
});