Closed Bug 1416893 Opened 8 years ago Closed 8 years ago

Add getConsumers method to nsIAccessibilityService.

Categories

(Core :: Disability Access APIs, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla59
Tracking Status
firefox59 --- fixed

People

(Reporter: yzen, Assigned: yzen)

Details

(Keywords: access)

Attachments

(1 file)

We need it to get consumers for cases when the service is already started and there is no 'a11y-consumers-changed' event.
Attached patch 1416893 patchSplinter Review
Attachment #8927990 - Flags: review?(surkov.alexander)
Comment on attachment 8927990 [details] [diff] [review] 1416893 patch Review of attachment 8927990 [details] [diff] [review]: ----------------------------------------------------------------- r=me with comments fixed/addressed ::: accessible/interfaces/nsIAccessibilityService.idl @@ +101,5 @@ > + /** > + * Get the current accessibility service consumers. > + * @returns a JSON string representing the accessibility service consumers. > + */ > + AString getConsumers(); i'd prefer to have a property. JSON string as a return value looks ugly, but it's ok as long as it for internal usage. I'd be nicer if we returned a JS object there so no JSON.parse would be required ::: accessible/tests/browser/browser_shutdown_remote_own_reference.js @@ +50,5 @@ > + const contentConsumers = await ContentTask.spawn(browser, {}, () => > + accService.getConsumers()); > + Assert.deepEqual(JSON.parse(contentConsumers), { > + XPCOM: true, MainProcess: true, PlatformAPI: false > + }, "Accessibility service consumers in parent are correct."); I must be missing something, you request consumers in a content process, and it says that MainProcess is true?
Attachment #8927990 - Flags: review?(surkov.alexander) → review+
(In reply to alexander :surkov from comment #2) > Comment on attachment 8927990 [details] [diff] [review] > 1416893 patch > > Review of attachment 8927990 [details] [diff] [review]: > ----------------------------------------------------------------- > > r=me with comments fixed/addressed > > ::: accessible/interfaces/nsIAccessibilityService.idl > @@ +101,5 @@ > > + /** > > + * Get the current accessibility service consumers. > > + * @returns a JSON string representing the accessibility service consumers. > > + */ > > + AString getConsumers(); > > i'd prefer to have a property. JSON string as a return value looks ugly, but > it's ok as long as it for internal usage. I'd be nicer if we returned a JS > object there so no JSON.parse would be required Yeah that was my original inclination, but I looked around and most xpcom props like that return a json string. > > ::: accessible/tests/browser/browser_shutdown_remote_own_reference.js > @@ +50,5 @@ > > + const contentConsumers = await ContentTask.spawn(browser, {}, () => > > + accService.getConsumers()); > > + Assert.deepEqual(JSON.parse(contentConsumers), { > > + XPCOM: true, MainProcess: true, PlatformAPI: false > > + }, "Accessibility service consumers in parent are correct."); > > I must be missing something, you request consumers in a content process, and > it says that MainProcess is true? You are correct, MainProcess true means that content process a11y service was started (has a consumer) by main process a11y.
Pushed by yura.zenevich@gmail.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/207a13b699ac Added getConsumers method to nsIAccessibilityService. r=surkov
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla59
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: