Commit c00939c5 authored by David Tseng's avatar David Tseng Committed by Chromium LUCI CQ

Omit selected value output for expanded <select>s in ChromeVox

R=akihiroota@chromium.org, josiahk@chromium.org

Fixed: 1161524
Test: existing browser_tests --gtest_filter=ChromeVox*.*Select*
Change-Id: I5c6e72b78bdcd7db829e67e712d8b7ce965b4de6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2602113Reviewed-by: default avatarAkihiro Ota <akihiroota@chromium.org>
Commit-Queue: David Tseng <dtseng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#839182}
parent 2eba819c
...@@ -276,7 +276,7 @@ TEST_F('ChromeVoxBackgroundTest', 'SelectSingleBasic', function() { ...@@ -276,7 +276,7 @@ TEST_F('ChromeVoxBackgroundTest', 'SelectSingleBasic', function() {
const mockFeedback = this.createMockFeedback(); const mockFeedback = this.createMockFeedback();
this.runWithLoadedTree(this.formsDoc, function() { this.runWithLoadedTree(this.formsDoc, function() {
mockFeedback.expectSpeech('apple', 'has pop up', 'Collapsed') mockFeedback.expectSpeech('apple', 'has pop up', 'Collapsed')
.expectBraille('apple btn +popup +') .expectBraille('apple btn +popup +3 +')
.call(press(KeyCode.DOWN)) .call(press(KeyCode.DOWN))
.expectSpeech('grape', /2 of 3/) .expectSpeech('grape', /2 of 3/)
.expectBraille('grape 2/3') .expectBraille('grape 2/3')
...@@ -712,6 +712,7 @@ TEST_F('ChromeVoxBackgroundTest', 'SelectOptionSelected', function() { ...@@ -712,6 +712,7 @@ TEST_F('ChromeVoxBackgroundTest', 'SelectOptionSelected', function() {
const mockFeedback = this.createMockFeedback(); const mockFeedback = this.createMockFeedback();
this.runWithLoadedTree( this.runWithLoadedTree(
` `
<p>start</p>
<select> <select>
<option>apple <option>apple
<option>banana <option>banana
...@@ -726,8 +727,10 @@ TEST_F('ChromeVoxBackgroundTest', 'SelectOptionSelected', function() { ...@@ -726,8 +727,10 @@ TEST_F('ChromeVoxBackgroundTest', 'SelectOptionSelected', function() {
options[options.length - 1].doDefault(); options[options.length - 1].doDefault();
}; };
mockFeedback.call(clickSelect) mockFeedback.call(doCmd('nextObject'))
.expectSpeech('apple') .expectSpeech('Button', 'Press Search+Space to activate')
.call(clickSelect)
.expectNextSpeechUtteranceIsNot('apple')
.expectSpeech('Button') .expectSpeech('Button')
.expectSpeech('Expanded') .expectSpeech('Expanded')
.call(selectLastOption) .call(selectLastOption)
......
...@@ -155,8 +155,7 @@ Output = class { ...@@ -155,8 +155,7 @@ Output = class {
return node.htmlAttributes['aria-posinset'] || return node.htmlAttributes['aria-posinset'] ||
(node.root.role !== RoleType.ROOT_WEB_AREA && node.posInSet); (node.root.role !== RoleType.ROOT_WEB_AREA && node.posInSet);
case 'setSize': case 'setSize':
return node.htmlAttributes['aria-setsize'] || return node.htmlAttributes['aria-setsize'] || node.setSize;
(node.root.role !== RoleType.ROOT_WEB_AREA && node.setSize);
// These attributes default to false for empty strings. // These attributes default to false for empty strings.
case 'roleDescription': case 'roleDescription':
...@@ -2304,7 +2303,11 @@ Output.ROLE_INFO_ = { ...@@ -2304,7 +2303,11 @@ Output.ROLE_INFO_ = {
note: {msgId: 'role_note', inherits: 'abstractContainer'}, note: {msgId: 'role_note', inherits: 'abstractContainer'},
progressIndicator: progressIndicator:
{msgId: 'role_progress_indicator', inherits: 'abstractRange'}, {msgId: 'role_progress_indicator', inherits: 'abstractRange'},
popUpButton: {msgId: 'role_button', earconId: 'POP_UP_BUTTON'}, popUpButton: {
msgId: 'role_button',
earconId: 'POP_UP_BUTTON',
inherits: 'comboBoxMenuButton'
},
radioButton: {msgId: 'role_radio'}, radioButton: {msgId: 'role_radio'},
radioGroup: {msgId: 'role_radiogroup', inherits: 'abstractContainer'}, radioGroup: {msgId: 'role_radiogroup', inherits: 'abstractContainer'},
region: {msgId: 'role_region', inherits: 'abstractContainer'}, region: {msgId: 'role_region', inherits: 'abstractContainer'},
...@@ -2484,8 +2487,9 @@ Output.RULES = { ...@@ -2484,8 +2487,9 @@ Output.RULES = {
}, },
client: {speak: `$name`}, client: {speak: `$name`},
comboBoxMenuButton: { comboBoxMenuButton: {
speak: `$name $value $node(activeDescendant) speak: `$name $if($collapsed, $value) $role @aria_has_popup
$state $restriction $role $description`, $if($setSize, @@list_with_items($setSize))
$state $restriction $description`,
}, },
date: {enter: `$nameFromNode $role $state $restriction $description`}, date: {enter: `$nameFromNode $role $state $restriction $description`},
dialog: {enter: `$nameFromNode $role $description $textContent`}, dialog: {enter: `$nameFromNode $role $description $textContent`},
...@@ -2575,12 +2579,6 @@ Output.RULES = { ...@@ -2575,12 +2579,6 @@ Output.RULES = {
$restriction $description` $restriction $description`
}, },
paragraph: {speak: `$nameOrDescendants`}, paragraph: {speak: `$nameOrDescendants`},
popUpButton: {
speak: `$name $if($value, $value, $descendants) $role @aria_has_popup
$if($expanded, @@list_with_items($setSize)) $state $restriction
$if($posInSet, @describe_index($posInSet, $setSize))
$description`
},
radioButton: { radioButton: {
speak: `$if($checked, $earcon(CHECK_ON), $earcon(CHECK_OFF)) speak: `$if($checked, $earcon(CHECK_ON), $earcon(CHECK_OFF))
$if($checked, @describe_radio_selected($name), $if($checked, @describe_radio_selected($name),
......
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