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

Provide output mappings for audio and video role

R=akihiroota@chromium.org

Bug: 111985
AX-Relnotes: ChromeVox provides feedback when entering or leaving an audio or video tag.
Test: browser_tests --gtest_filter=ChromeVox*.AudioVideo
Change-Id: Ia0b38a5dde6f7554ad476dc61ccf910fd11d5658
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2377110Reviewed-by: default avatarAkihiro Ota <akihiroota@chromium.org>
Commit-Queue: David Tseng <dtseng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#801971}
parent 562a6be4
...@@ -2904,3 +2904,42 @@ TEST_F('ChromeVoxBackgroundTest', 'InlineLineNavigation', function() { ...@@ -2904,3 +2904,42 @@ TEST_F('ChromeVoxBackgroundTest', 'InlineLineNavigation', function() {
.replay(); .replay();
}); });
}); });
TEST_F('ChromeVoxBackgroundTest', 'AudioVideo', function() {
const mockFeedback = this.createMockFeedback();
this.runWithLoadedTree(
`
<button></button>
<button></button>
`,
function(root) {
const [audio, video] = root.findAll({role: RoleType.BUTTON});
assertNotNullNorUndefined(audio);
assertNotNullNorUndefined(video);
assertEquals('', audio.name);
assertEquals('', video.name);
assertEquals(undefined, audio.firstChild);
assertEquals(undefined, video.firstChild);
// Fake the roles.
Object.defineProperty(audio, 'role', {
get() {
return chrome.automation.RoleType.AUDIO;
}
});
Object.defineProperty(video, 'role', {
get() {
return chrome.automation.RoleType.VIDEO;
}
});
mockFeedback.call(doCmd('nextObject'))
.expectSpeech('Video')
.call(doCmd('previousObject'))
.expectSpeech('Audio')
.replay();
});
});
...@@ -2169,6 +2169,7 @@ Output.ROLE_INFO_ = { ...@@ -2169,6 +2169,7 @@ Output.ROLE_INFO_ = {
alertDialog: {msgId: 'role_alertdialog', outputContextFirst: true}, alertDialog: {msgId: 'role_alertdialog', outputContextFirst: true},
article: {msgId: 'role_article', inherits: 'abstractItem'}, article: {msgId: 'role_article', inherits: 'abstractItem'},
application: {msgId: 'role_application', inherits: 'abstractContainer'}, application: {msgId: 'role_application', inherits: 'abstractContainer'},
audio: {msgId: 'tag_audio', inherits: 'abstractContainer'},
banner: {msgId: 'role_banner', inherits: 'abstractContainer'}, banner: {msgId: 'role_banner', inherits: 'abstractContainer'},
button: {msgId: 'role_button', earconId: 'BUTTON', inherits: 'button'}, button: {msgId: 'role_button', earconId: 'BUTTON', inherits: 'button'},
buttonDropDown: {msgId: 'role_button', earconId: 'BUTTON'}, buttonDropDown: {msgId: 'role_button', earconId: 'BUTTON'},
...@@ -2321,6 +2322,7 @@ Output.ROLE_INFO_ = { ...@@ -2321,6 +2322,7 @@ Output.ROLE_INFO_ = {
toggleButton: {msgId: 'role_toggle_button', inherits: 'checkBox'}, toggleButton: {msgId: 'role_toggle_button', inherits: 'checkBox'},
tree: {msgId: 'role_tree'}, tree: {msgId: 'role_tree'},
treeItem: {msgId: 'role_treeitem'}, treeItem: {msgId: 'role_treeitem'},
video: {msgId: 'tag_video', inherits: 'abstractContainer'},
window: {ignoreAncestry: true} window: {ignoreAncestry: true}
}; };
......
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