Marionette instantiates a11y in content but not chrome

RESOLVED FIXED in Firefox 52

Status

defect
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: aklotz, Assigned: yzen)

Tracking

Version 3
mozilla52
Unspecified
Windows
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox52 fixed)

Details

(Whiteboard: aes+)

Attachments

(1 attachment)

Reporter

Description

3 years ago
Bug 1310833 was backed out because it crashes under marionette e10s. This happens because marionette instantiated a11y in content but not chrome.

This is not currently something that is supported; a11y on e10s currently expects a11y to be requested in chrome, and then the chrome process propagates that request down to content with other important information.

It would be nice if marionette could be modified to request a11y from chrome ahead of time.
Reporter

Comment 1

3 years ago
Henrik, is such a change feasible?
Flags: needinfo?(hskupin)
Reporter

Updated

3 years ago
Whiteboard: aes+
I will have to defer to Yura here, given that I do not know any a11y internals at all. He should be back by next week. I hope it can wait a bit?
Flags: needinfo?(hskupin) → needinfo?(yzenevich)
Something related to this is also bug 1277791.
See Also: → 1277791
Assignee

Updated

3 years ago
Assignee: nobody → yzenevich
Status: NEW → ASSIGNED
Assignee

Comment 6

3 years ago
Note: this patch also handles cases where a11y would be still started even in cases where raise a11y exceptions capabilities is not set. I think at this point it is fair to say that that use case is useless.
Assignee

Comment 7

3 years ago
^ It should help with bug 1258931 and bug 1251782 I believe too

Comment 8

3 years ago
mozreview-review
Comment on attachment 8807143 [details]
Bug 1312816 - Preemptively start a11y in chrome when raisesAccessibilityExceptions marionette capability is set.

https://reviewboard.mozilla.org/r/90406/#review90802

::: testing/marionette/accessibility.js:22
(Diff revision 1)
>      this, "setInterval", "resource://gre/modules/Timer.jsm");
>  XPCOMUtils.defineLazyModuleGetter(
>      this, "clearInterval", "resource://gre/modules/Timer.jsm");
>  
> -XPCOMUtils.defineLazyGetter(this, "service",
> -    () => Cc["@mozilla.org/accessibilityService;1"].getService(Ci.nsIAccessibilityService));
> +XPCOMUtils.defineLazyGetter(this, "service", () => {
> +  let service = null;

Drop `null`.  Should return `undefined` if error happens.

::: testing/marionette/accessibility.js:27
(Diff revision 1)
> -    () => Cc["@mozilla.org/accessibilityService;1"].getService(Ci.nsIAccessibilityService));
> +  let service = null;
> +  try {
> +    service = Cc["@mozilla.org/accessibilityService;1"].getService(
> +      Ci.nsIAccessibilityService);
> +  } catch (e) {
> +    logger.warn("Accessibility module is not present.");

Drop `.`

::: testing/marionette/accessibility.js:139
(Diff revision 1)
>     * @return {nsIAccessible}
>     *     Accessibility object for the given element.

This returns a promise with an `nsIAccessible` apparently:

    @return {Promise: nsIAccessible}

::: testing/marionette/driver.js:638
(Diff revision 1)
> +  // If we are testing accessibility with marionette, start a11y service in
> +  // chrome first. This will ensure that we do not have any content-only
> +  // services hanging around.
> +  if (this.sessionCapabilities.raisesAccessibilityExceptions &&
> +      accessibility.service) {
> +    logger.info("Preemptively starting accessibility service in Chrome.");
> +  }

Move to `GeckoDriver#newSession`, after `setSessionCapabilities` has been called.

::: testing/marionette/driver.js:643
(Diff revision 1)
> +  // If we are testing accessibility with marionette, start a11y service in
> +  // chrome first. This will ensure that we do not have any content-only
> +  // services hanging around.
> +  if (this.sessionCapabilities.raisesAccessibilityExceptions &&
> +      accessibility.service) {
> +    logger.info("Preemptively starting accessibility service in Chrome.");

Drop `.`
Attachment #8807143 - Flags: review?(ato) → review+
Comment hidden (mozreview-request)

Comment 10

3 years ago
Pushed by yura.zenevich@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/4e6109ba565c
Preemptively start a11y in chrome when raisesAccessibilityExceptions marionette capability is set. r=ato

Comment 11

3 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/4e6109ba565c
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla52
You need to log in before you can comment on or make changes to this bug.