Bug 1244837 - only performing multiple attempts to retrieve an accessible object iff raisesAccessibilityExceptions capability is set to true. r=ato
authorYura Zenevich <yzenevich@mozilla.com>
Wed, 03 Feb 2016 15:13:00 -0500
changeset 283101 2564c91f9a5cb8d58e8183f0219aeae5a7492103
parent 283100 c20656666ba409b46a64d5c2f33b24e9e660d576
child 283102 7e7eb92b685621254167b844f0737fc4513d7f4a
push id29974
push usercbook@mozilla.com
push dateFri, 05 Feb 2016 10:53:43 +0000
treeherdermozilla-central@1dbe350b57b1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersato
bugs1244837
milestone47.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1244837 - only performing multiple attempts to retrieve an accessible object iff raisesAccessibilityExceptions capability is set to true. r=ato
testing/marionette/accessibility.js
--- a/testing/marionette/accessibility.js
+++ b/testing/marionette/accessibility.js
@@ -119,16 +119,20 @@ Accessibility.prototype = {
   getAccessibleObject(element, mustHaveAccessible = false) {
     return new Promise((resolve, reject) => {
       let acc = this.retrieval.getAccessibleFor(element);
 
       if (acc || !mustHaveAccessible) {
         // If accessible object is found, return it. If it is not required,
         // also resolve.
         resolve(acc);
+      } else if (mustHaveAccessible && !this.strict) {
+        // If we must have an accessible but are not raising accessibility
+        // exceptions, reject now and avoid polling for an accessible object.
+        reject();
       } else {
         // If we require an accessible object, we need to poll for it because
         // accessible tree might be out of sync with DOM tree for a short time.
         let attempts = this.GET_ACCESSIBLE_ATTEMPTS;
         let intervalId = setInterval(() => {
           let acc = this.retrieval.getAccessibleFor(element);
           if (acc || --attempts <= 0) {
             clearInterval(intervalId);