зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1828816 part 2: Marionette accessibility.getAccessible: If the requested Accessible doesn't exist, wait for it to be created. r=jdescottes,webdriver-reviewers,whimboo
Some tests dynamically add elements to the DOM. Since accessibility updates occur in refresh driver ticks, the Accessible often wasn't created yet when WebDriver requested it, causing intermittent WPT failures. See the code comments for an explanation of how this works. Differential Revision: https://phabricator.services.mozilla.com/D175972
This commit is contained in:
Родитель
d507939b50
Коммит
8da53261a2
|
@ -140,7 +140,34 @@ accessibility.getAccessible = async function(element) {
|
|||
}
|
||||
|
||||
// First, wait for accessibility to be ready for the element's document.
|
||||
// We do not use a timeout here because we can guarantee that the document
|
||||
// accessible will be ready eventually, even if it takes a while.
|
||||
await waitForDocumentAccessibility(element.ownerDocument);
|
||||
|
||||
const acc = accessibility.service.getAccessibleFor(element);
|
||||
if (acc) {
|
||||
return acc;
|
||||
}
|
||||
|
||||
// The Accessible doesn't exist yet. This can happen because a11y tree
|
||||
// mutations happen during refresh driver ticks. Wait for a11y events,
|
||||
// checking after each event to see if the Accessible exists yet and returning
|
||||
// it if it does. Stop waiting after a short timeout because the Accessible
|
||||
// might never be created and we want to report a failure without breaking
|
||||
// subsequent tests.
|
||||
try {
|
||||
await lazy.waitForObserverTopic("accessible-event", {
|
||||
checkFn: subject => {
|
||||
return !!accessibility.service.getAccessibleFor(element);
|
||||
},
|
||||
timeout: 100,
|
||||
});
|
||||
} catch (e) {
|
||||
// Don't treat a timeout as an error. We will most likely return null below.
|
||||
if (!(e instanceof lazy.error.TimeoutError)) {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
return accessibility.service.getAccessibleFor(element);
|
||||
};
|
||||
|
||||
|
|
|
@ -1,167 +1,20 @@
|
|||
[roles.html]
|
||||
[role: alertdialog]
|
||||
expected: [PASS, FAIL]
|
||||
|
||||
[role: application]
|
||||
expected: [PASS, FAIL]
|
||||
|
||||
[role: article]
|
||||
expected: [PASS, FAIL]
|
||||
|
||||
[role: banner]
|
||||
expected: [PASS, FAIL]
|
||||
|
||||
[role: button]
|
||||
expected: [PASS, FAIL]
|
||||
|
||||
[role: checkbox]
|
||||
expected: [PASS, FAIL]
|
||||
|
||||
[role: combobox]
|
||||
expected: [PASS, FAIL]
|
||||
|
||||
[role: complementary]
|
||||
expected: [PASS, FAIL]
|
||||
|
||||
[role: contentinfo]
|
||||
expected: [PASS, FAIL]
|
||||
|
||||
[role: definition]
|
||||
expected: FAIL
|
||||
bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1829028
|
||||
|
||||
[role: deletion]
|
||||
expected: [PASS, FAIL]
|
||||
|
||||
[role: document]
|
||||
expected: [PASS, FAIL]
|
||||
|
||||
[role: emphasis]
|
||||
expected: FAIL
|
||||
bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1732306
|
||||
|
||||
[role: feed]
|
||||
expected: [PASS, FAIL]
|
||||
|
||||
[role: generic]
|
||||
expected: [PASS, FAIL]
|
||||
|
||||
[role: group]
|
||||
expected: [PASS, FAIL]
|
||||
|
||||
[role: insertion]
|
||||
expected: [PASS, FAIL]
|
||||
|
||||
[role: log]
|
||||
expected: [PASS, FAIL]
|
||||
|
||||
[role: main]
|
||||
expected: [PASS, FAIL]
|
||||
|
||||
[role: marquee]
|
||||
expected: [PASS, FAIL]
|
||||
|
||||
[role: math]
|
||||
expected: [PASS, FAIL]
|
||||
|
||||
[role: navigation]
|
||||
expected: [PASS, FAIL]
|
||||
|
||||
[role: radio]
|
||||
expected: [PASS, FAIL]
|
||||
|
||||
[role: radiogroup]
|
||||
expected: [PASS, FAIL]
|
||||
|
||||
[role: search]
|
||||
expected: [PASS, FAIL]
|
||||
|
||||
[role: searchbox]
|
||||
expected: [PASS, FAIL]
|
||||
|
||||
[role: status]
|
||||
expected: [PASS, FAIL]
|
||||
|
||||
[role: strong]
|
||||
expected: FAIL
|
||||
bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1732306
|
||||
|
||||
[role: textbox]
|
||||
expected: [PASS, FAIL]
|
||||
|
||||
[role: time]
|
||||
expected: FAIL
|
||||
bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1732306
|
||||
|
||||
[role: timer]
|
||||
expected: [PASS, FAIL]
|
||||
|
||||
[role: blockquote]
|
||||
expected: [PASS, FAIL]
|
||||
|
||||
[role: caption]
|
||||
expected: [PASS, FAIL]
|
||||
|
||||
[role: code]
|
||||
expected: [PASS, FAIL]
|
||||
|
||||
[role: dialog]
|
||||
expected: [PASS, FAIL]
|
||||
|
||||
[role: figure]
|
||||
expected: [PASS, FAIL]
|
||||
|
||||
[role: form]
|
||||
expected: [PASS, FAIL]
|
||||
|
||||
[role: heading]
|
||||
expected: [PASS, FAIL]
|
||||
|
||||
[role: link]
|
||||
expected: [PASS, FAIL]
|
||||
|
||||
[role: meter]
|
||||
expected: [PASS, FAIL]
|
||||
|
||||
[role: note]
|
||||
expected: [PASS, FAIL]
|
||||
|
||||
[role: paragraph]
|
||||
expected: [PASS, FAIL]
|
||||
|
||||
[role: progressbar]
|
||||
expected: [PASS, FAIL]
|
||||
|
||||
[role: scrollbar]
|
||||
expected: [PASS, FAIL]
|
||||
|
||||
[role: separator]
|
||||
expected: [PASS, FAIL]
|
||||
|
||||
[role: slider]
|
||||
expected: [PASS, FAIL]
|
||||
|
||||
[role: spinbutton]
|
||||
expected: [PASS, FAIL]
|
||||
|
||||
[role: subscript]
|
||||
expected: [PASS, FAIL]
|
||||
|
||||
[role: suggestion]
|
||||
expected: [PASS, FAIL]
|
||||
|
||||
[role: superscript]
|
||||
expected: [PASS, FAIL]
|
||||
|
||||
[role: switch]
|
||||
expected: [PASS, FAIL]
|
||||
|
||||
[role: term]
|
||||
expected: FAIL
|
||||
bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1829028
|
||||
|
||||
[role: toolbar]
|
||||
expected: [PASS, FAIL]
|
||||
|
||||
[role: tooltip]
|
||||
expected: [PASS, FAIL]
|
||||
|
|
Загрузка…
Ссылка в новой задаче