Commit fef9952f authored by David Tseng's avatar David Tseng Committed by Commit Bot

Use value changes for reading popup buttons in ChromeVox

Change-Id: I86274af81a2d60223813cdfb91253abca97a766b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2465383Reviewed-by: default avatarAdam Ettenberger <Adam.Ettenberger@microsoft.com>
Commit-Queue: David Tseng <dtseng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#816219}
parent c95032ee
...@@ -42,7 +42,7 @@ FocusAutomationHandler = class extends BaseAutomationHandler { ...@@ -42,7 +42,7 @@ FocusAutomationHandler = class extends BaseAutomationHandler {
EventType.ACTIVE_DESCENDANT_CHANGED, this.onActiveDescendantChanged); EventType.ACTIVE_DESCENDANT_CHANGED, this.onActiveDescendantChanged);
this.addListener_( this.addListener_(
EventType.MENU_LIST_ITEM_SELECTED, this.onEventIfSelected); EventType.MENU_LIST_ITEM_SELECTED, this.onEventIfSelected);
this.addListener_(EventType.TEXT_CHANGED, this.onTextChanged_); this.addListener_(EventType.VALUE_CHANGED, this.onValueChanged_);
} }
/** /**
...@@ -92,9 +92,7 @@ FocusAutomationHandler = class extends BaseAutomationHandler { ...@@ -92,9 +92,7 @@ FocusAutomationHandler = class extends BaseAutomationHandler {
/** /**
* @param {!ChromeVoxEvent} evt * @param {!ChromeVoxEvent} evt
*/ */
onTextChanged_(evt) { onValueChanged_(evt) {
// TODO: listen to value changes instead when they are generated.
// Here only to handle popup buttons.
if (evt.target.role != RoleType.POP_UP_BUTTON || if (evt.target.role != RoleType.POP_UP_BUTTON ||
evt.target.state.editable) { evt.target.state.editable) {
return; return;
......
...@@ -60,11 +60,7 @@ TEST_F('ChromeVoxOptionsTest', 'NumberReadingStyleSelect', function() { ...@@ -60,11 +60,7 @@ TEST_F('ChromeVoxOptionsTest', 'NumberReadingStyleSelect', function() {
.call(press(KeyCode.DOWN)) .call(press(KeyCode.DOWN))
.expectSpeech('Digits', 'List item', ' 2 of 2 ') .expectSpeech('Digits', 'List item', ' 2 of 2 ')
.call(press(KeyCode.RETURN)) .call(press(KeyCode.RETURN))
.expectSpeech('Digits', 'Collapsed')
// TODO: The underlying select behavior here is unexpected because we
// never get a new focus event for the select (moving us away from the
// menu item). We simply repeat the menu item.
.expectSpeech('Digits', ' 2 of 2 ')
.call(() => { .call(() => {
assertEquals('asDigits', localStorage['numberReadingStyle']); assertEquals('asDigits', localStorage['numberReadingStyle']);
}) })
...@@ -108,11 +104,7 @@ TEST_F_WITH_PREAMBLE( ...@@ -108,11 +104,7 @@ TEST_F_WITH_PREAMBLE(
.call(press(KeyCode.DOWN)) .call(press(KeyCode.DOWN))
.expectSpeech('Some', 'List item', ' 2 of 3 ') .expectSpeech('Some', 'List item', ' 2 of 3 ')
.call(press(KeyCode.RETURN)) .call(press(KeyCode.RETURN))
.expectSpeech('Some', 'Collapsed')
// TODO(josiahk): The underlying select behavior here is unexpected
// because we never get a new focus event for the select (moving us
// away from the menu item). We simply repeat the menu item.
.expectSpeech('Some', ' 2 of 3 ')
.call(() => { .call(() => {
assertEquals( assertEquals(
PUNCTUATION_ECHO_SOME, PUNCTUATION_ECHO_SOME,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment