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

Queue all output by default

ChromeVox has "force flush" behavior when it receives user input via qwerty keys, braille keys, and touch (explore/gestures).
It also has programmatic queue behaviors via Output.withQueueMode.
By default, ChromeVox is ready to queue all other output.

This will help ChromeVox be flexible when receiving events and not dropping output. For example, when pressing Ctrl+l, we receive focus on the omnibox and quickly after, a selection event on the listbox option auto completion.

This is a separate change to ensure we don't miss any corner cases and have to revert.

Test: existing tests/manually on omnibox.
Change-Id: Iba069c5794fe8cc2b3318c64a87dbd4cc7df6385
Reviewed-on: https://chromium-review.googlesource.com/c/1302414
Commit-Queue: David Tseng <dtseng@chromium.org>
Reviewed-by: default avatarDominic Mazzoni <dmazzoni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#603572}
parent 78f3d60a
...@@ -46,6 +46,14 @@ ChromeVoxLiveRegionsTest.prototype = { ...@@ -46,6 +46,14 @@ ChromeVoxLiveRegionsTest.prototype = {
CommandHandler.onCommand(cmd); CommandHandler.onCommand(cmd);
}; };
}, },
/**
* Simulates work done when users interact using keyboard, braille, or
* touch.
*/
simulateUserInteraction: function() {
Output.forceModeForNextSpeechUtterance(cvox.QueueMode.FLUSH);
},
}; };
TEST_F('ChromeVoxLiveRegionsTest', 'LiveRegionAddElement', function() { TEST_F('ChromeVoxLiveRegionsTest', 'LiveRegionAddElement', function() {
...@@ -183,9 +191,10 @@ TEST_F('ChromeVoxLiveRegionsTest', 'LiveRegionThenFocus', function() { ...@@ -183,9 +191,10 @@ TEST_F('ChromeVoxLiveRegionsTest', 'LiveRegionThenFocus', function() {
*/}, */},
function(rootNode) { function(rootNode) {
var go = rootNode.find({ role: RoleType.BUTTON }); var go = rootNode.find({ role: RoleType.BUTTON });
mockFeedback.call(go.doDefault.bind(go)) mockFeedback.call(this.simulateUserInteraction.bind(this))
.expectCategoryFlushSpeech('Live') .call(go.doDefault.bind(go))
.expectCategoryFlushSpeech('Focus'); .expectFlushingSpeech('Live')
.expectQueuedSpeech('Focus');
mockFeedback.replay(); mockFeedback.replay();
}); });
}); });
...@@ -208,8 +217,9 @@ TEST_F('ChromeVoxLiveRegionsTest', 'FocusThenLiveRegion', function() { ...@@ -208,8 +217,9 @@ TEST_F('ChromeVoxLiveRegionsTest', 'FocusThenLiveRegion', function() {
*/}, */},
function(rootNode) { function(rootNode) {
var go = rootNode.find({ role: RoleType.BUTTON }); var go = rootNode.find({ role: RoleType.BUTTON });
mockFeedback.call(go.doDefault.bind(go)) mockFeedback.call(this.simulateUserInteraction.bind(this))
.expectCategoryFlushSpeech('Focus') .call(go.doDefault.bind(go))
.expectFlushingSpeech('Focus')
.expectCategoryFlushSpeech('Live'); .expectCategoryFlushSpeech('Live');
mockFeedback.replay(); mockFeedback.replay();
}); });
......
...@@ -1002,7 +1002,7 @@ Output.prototype = { ...@@ -1002,7 +1002,7 @@ Output.prototype = {
*/ */
go: function() { go: function() {
// Speech. // Speech.
var queueMode = cvox.QueueMode.CATEGORY_FLUSH; var queueMode = cvox.QueueMode.QUEUE;
if (Output.forceModeForNextSpeechUtterance_ !== undefined) { if (Output.forceModeForNextSpeechUtterance_ !== undefined) {
queueMode = /** @type{cvox.QueueMode} */ ( queueMode = /** @type{cvox.QueueMode} */ (
Output.forceModeForNextSpeechUtterance_); Output.forceModeForNextSpeechUtterance_);
......
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