Chromium Code Reviews| Index: chrome/browser/resources/chromeos/chromevox/testing/mock_feedback.js |
| diff --git a/chrome/browser/resources/chromeos/chromevox/testing/mock_feedback.js b/chrome/browser/resources/chromeos/chromevox/testing/mock_feedback.js |
| index 4c846e8f7f433b8b5d299d7db85a741645380192..f853a2a11a0f3e91b69316de17552f6bc0466784 100644 |
| --- a/chrome/browser/resources/chromeos/chromevox/testing/mock_feedback.js |
| +++ b/chrome/browser/resources/chromeos/chromevox/testing/mock_feedback.js |
| @@ -160,6 +160,55 @@ MockFeedback.prototype = { |
| }, |
| /** |
| + * Adds an expectation for one spoken utterance that will be enqueued |
| + * with a given queue mode. |
| + * @param {string|RegExp} text One utterance expectation. |
| + * @param {cvox.QueueMode} queueMode The expected queue mode. |
| + * @return {MockFeedback} |this| for chaining |
| + */ |
| + expectSpeechWithQueueMode: function(text, queueMode) { |
| + assertFalse(this.replaying_); |
| + this.pendingActions_.push({ |
| + perform: function() { |
| + return !!MockFeedback.matchAndConsume_( |
| + text, {queueMode: queueMode}, this.pendingUtterances_); |
| + }.bind(this), |
| + toString: function() { |
| + return 'Speak \'' + text + '\' with mode ' + queueMode; |
| + } |
| + }); |
| + return this; |
| + }, |
| + |
| + /** |
| + * Adds an expectation for one spoken utterance that will be queued. |
| + * @param {string|RegExp} text One utterance expectation. |
| + * @return {MockFeedback} |this| for chaining |
| + */ |
| + expectQueue: function(text) { |
|
Peter Lundblad
2015/11/20 13:42:58
expectQueuedSpeech?
dmazzoni
2015/11/23 20:16:50
Done.
|
| + return this.expectSpeechWithQueueMode(text, cvox.QueueMode.QUEUE); |
| + }, |
| + |
| + /** |
| + * Adds an expectation for one spoken utterance that will be flushed. |
| + * @param {string|RegExp} text One utterance expectation. |
| + * @return {MockFeedback} |this| for chaining |
| + */ |
| + expectFlush: function(text) { |
|
Peter Lundblad
2015/11/20 13:42:59
expectFlushingSpeech?
dmazzoni
2015/11/23 20:16:50
Done.
|
| + return this.expectSpeechWithQueueMode(text, cvox.QueueMode.FLUSH); |
| + }, |
| + |
| + /** |
| + * Adds an expectation for one spoken utterance that will be queued |
| + * with the category flush mode. |
| + * @param {string|RegExp} text One utterance expectation. |
| + * @return {MockFeedback} |this| for chaining |
| + */ |
| + expectCategoryFlush: function(text) { |
|
Peter Lundblad
2015/11/20 13:42:58
expectCategoryFlushSpeech?
dmazzoni
2015/11/23 20:16:50
Done.
|
| + return this.expectSpeechWithQueueMode(text, cvox.QueueMode.CATEGORY_FLUSH); |
| + }, |
| + |
| + /** |
| * Adds an expectation that the next spoken utterances do *not* match |
| * the given arguments. |
| * |
| @@ -299,6 +348,7 @@ MockFeedback.prototype = { |
| } |
| this.pendingUtterances_.push( |
| {text: textString, |
| + queueMode: queueMode, |
| callback: callback}); |
| this.process_(); |
| }, |