Closed Bug 1171184 Opened 9 years ago Closed 9 years ago

[AccessFu] Pass options along with the announce event

Categories

(Core :: Disability Access APIs, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 994715

People

(Reporter: obara.justin, Assigned: obara.justin)

References

Details

(Keywords: access)

Attachments

(1 file, 3 obsolete files)

For Bug 1169019 a force option will be added to the speak method, which will allow for speech synthesis when the screenreader is disabled. (e.g. to announce that the screenreader has been disabled, instructions for enabling/disabling). To make use of this new flow, the announcement event from gecko needs to pass along the options to ensure that the disabled state is announced.
I'm having some trouble with the unit test. I'm trying to extend the existing one by verifying that the options are passed down. However, the test is failing with a rather unhelpful error messages.

Data is correct -     Structures begin differing at:
got['options'] = [object Object]
expected['options'] = [object Object]

Is there a way to debug this? I tried to add a console log into the _addObserver method of jsatcommon.js but it didn't seem to output.

Changes: https://github.com/mozilla/gecko-dev/compare/master...jobara:1171184
Flags: needinfo?(yzenevich)
(In reply to jobara from comment #1)
> I'm having some trouble with the unit test. I'm trying to extend the
> existing one by verifying that the options are passed down. However, the
> test is failing with a rather unhelpful error messages.
> 
> Data is correct -     Structures begin differing at:
> got['options'] = [object Object]
> expected['options'] = [object Object]
> 
> Is there a way to debug this? I tried to add a console log into the
> _addObserver method of jsatcommon.js but it didn't seem to output.
> 
> Changes: https://github.com/mozilla/gecko-dev/compare/master...jobara:1171184

So it looks like the options block content is somehow different, I would suggest taking a look at jsatcommon.js and seeing where we log things and trying to stringify the diff (instead of getting [object Object]). In fact that can be part of the patch. I think to log in test we use built in info() from mochitest framework itself.
Flags: needinfo?(yzenevich)
(In reply to Yura Zenevich [:yzen] from comment #2)
> (In reply to jobara from comment #1)
> > I'm having some trouble with the unit test. I'm trying to extend the
> > existing one by verifying that the options are passed down. However, the
> > test is failing with a rather unhelpful error messages.
> > 
> > Data is correct -     Structures begin differing at:
> > got['options'] = [object Object]
> > expected['options'] = [object Object]
> > 
> > Is there a way to debug this? I tried to add a console log into the
> > _addObserver method of jsatcommon.js but it didn't seem to output.
> > 
> > Changes: https://github.com/mozilla/gecko-dev/compare/master...jobara:1171184
> 
> So it looks like the options block content is somehow different, I would
> suggest taking a look at jsatcommon.js and seeing where we log things and
> trying to stringify the diff (instead of getting [object Object]). In fact
> that can be part of the patch. I think to log in test we use built in info()
> from mochitest framework itself.

It looks like Logger is used. I'm using Logger.debug('message') to log the stringified versions of the objects. They are indeed different, as data.details is missing options: {force: true}
Attached patch Bug-1171184.patch (obsolete) — Splinter Review
Add Bug-1171184.patch which adds the ability to pass options along to the announce method.
Attachment #8632597 - Flags: review?(yzenevich)
Comment on attachment 8632597 [details] [diff] [review]
Bug-1171184.patch

Review of attachment 8632597 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good with my comment. Note I think the patch might be malformed as I can't see all the changes in Presentation.jsm (though in raw view they look good). Just flag me for r? once the above comment is addressed.

::: accessible/tests/mochitest/jsat/jsatcommon.js
@@ +78,4 @@
>        if (!data) {
>          return;
>        }
> +      Logger.debug('data.details:', JSON.stringify(data.details), "aWaitForData:", JSON.stringify(aWaitForData));

This should probably be removed.
Attachment #8632597 - Flags: review?(yzenevich)
Attachment #8632597 - Attachment is obsolete: true
Attachment #8633784 - Flags: review?(yzenevich)
(In reply to jobara from comment #7)
> Created attachment 8633784 [details] [diff] [review]
> Bug-1171184-b.patch - removes logger call

hmm still looks like the same file attached, Justin, could you double check that it looks as expected?
Flags: needinfo?(obara.justin)
I'm not really sure why, but the logger call keeps showing up in my patch despite the fact that it is no longer in the code. I've manually removed the line from the patch. Hopefully it still applies okay.
Attachment #8633784 - Attachment is obsolete: true
Attachment #8633784 - Flags: review?(yzenevich)
Flags: needinfo?(obara.justin)
Attachment #8634020 - Flags: review?(yzenevich)
(In reply to jobara from comment #9)
> Created attachment 8634020 [details] [diff] [review]
> Bug-1171184-c.patch - removes logger call
> 
> I'm not really sure why, but the logger call keeps showing up in my patch
> despite the fact that it is no longer in the code. I've manually removed the
> line from the patch. Hopefully it still applies okay.

So based on the patch message I think you have more than 1 commit in the branch. Could you ensure there's only one (by squashing) before you call git format patch and git patch to hg patch
Sorry, forgot to squash all the commits down. I've done that with Bug-1171184-d.patch.
Attachment #8634020 - Attachment is obsolete: true
Attachment #8634469 - Flags: review?(yzenevich)
Comment on attachment 8634469 [details] [diff] [review]
Bug-1171184-d.patch: squashed commits

Review of attachment 8634469 [details] [diff] [review]:
-----------------------------------------------------------------

r=me with one final nit addressed. Also add r=yzen in the commit message and mark for checkin-needed. Thanks, Justin!

::: accessible/tests/mochitest/jsat/jsatcommon.js
@@ +78,4 @@
>        if (!data) {
>          return;
>        }
> +      isDeeply(data.details, aWaitForData, 'Data is correct');

Nit: not part of this patch, lets keep this out.
Attachment #8634469 - Flags: review?(yzenevich) → review+
Actually, Justin: Eitan and I talked about it more right now and it makes more sense to move announcements about screen reader on and off from Gecko to Gaia and only do it there. Perhaps you would be OK to rename this bug to something close to that. Then the dependent bug for Gaia will be about adding screen reader on/off notifications + simplifying speak logic.
(In reply to Yura Zenevich [:yzen] from comment #13)
> Actually, Justin: Eitan and I talked about it more right now and it makes
> more sense to move announcements about screen reader on and off from Gecko
> to Gaia and only do it there. Perhaps you would be OK to rename this bug to
> something close to that. Then the dependent bug for Gaia will be about
> adding screen reader on/off notifications + simplifying speak logic.

There is a Gaia one already related to this. https://bugzilla.mozilla.org/show_bug.cgi?id=994715
Should this one just be closed?
After discussion with Yura and Eitan it was decided that the screen reader announcements should remain in Gaia. https://bugzilla.mozilla.org/show_bug.cgi?id=994715 already covers this work.
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: