Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2175)

Unified Diff: chrome/browser/resources/chromeos/chromevox/testing/mock_feedback.js

Issue 1318683002: Make cvox2 feedback more robust when focusing a text field. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mock_feedback
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 795f268bc20ceb8bea6010ff034b15cc067df925..29caaf1a4960a9715ffd9c43f03cc6fe0ce6c815 100644
--- a/chrome/browser/resources/chromeos/chromevox/testing/mock_feedback.js
+++ b/chrome/browser/resources/chromeos/chromevox/testing/mock_feedback.js
@@ -141,6 +141,31 @@ MockFeedback.prototype = {
},
/**
+ * Adds an expectation that a given utterance will not be spoken.
+ * @param {...(string|RegExp)} var_args One or more utterance to add as
+ * negative expectations.
+ * @return {MockFeedback} |this| for chaining
+ */
+ expectNoSpeech: function() {
Peter Lundblad 2015/08/26 16:56:13 I think this only works if the unexpected utteranc
dmazzoni 2015/08/26 18:18:23 Good point. How about expectNextSpeechUtteranceIsN
+ assertFalse(this.replaying_);
+ Array.prototype.forEach.call(arguments, function(text) {
+ this.pendingActions_.push({
+ perform: function() {
+ if (this.pendingUtterances_.length == 0)
+ return false;
+ if (MockFeedback.matchAndConsume_(
+ text, {}, this.pendingUtterances_)) {
+ throw new Error('Got disallowed utterance "' + text + '".');
+ }
+ return true;
+ }.bind(this),
+ toString: function() { return 'Do not speak \'' + text + '\''; }
+ });
+ }.bind(this));
+ return this;
+ },
+
+ /**
* Adds an expectation for braille output.
* @param {string|RegExp} text
* @param {Object=} opt_props Additional properties to match in the
@@ -218,6 +243,7 @@ MockFeedback.prototype = {
* @private
*/
addUtterance_: function(textString, queueMode, properties) {
+ console.log('*** ADDUTTERANCE ' + textString);
Peter Lundblad 2015/08/26 16:56:13 Intentional?
dmazzoni 2015/08/26 18:18:23 Oops, meant to remove that. Is there a way to add
var callback;
if (properties && (properties.startCallback || properties.endCallback)) {
var startCallback = properties.startCallback;

Powered by Google App Engine
This is Rietveld 408576698