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

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

Issue 674263003: Add remaining text/caret navigation commands to ChromeVox Next. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@integrate_cursor
Patch Set: Add comments. Created 6 years, 2 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_tts.js
diff --git a/chrome/browser/resources/chromeos/chromevox/testing/mock_tts.js b/chrome/browser/resources/chromeos/chromevox/testing/mock_tts.js
index c01feff689bda403b9b11a3b197d0c1aed0d026d..17562cdfb187722b82f1175fac30af6f7c7ffa1d 100644
--- a/chrome/browser/resources/chromeos/chromevox/testing/mock_tts.js
+++ b/chrome/browser/resources/chromeos/chromevox/testing/mock_tts.js
@@ -49,14 +49,15 @@ MockTts.prototype = {
* executes.
* @param {string} expectedText
* @param {function() : void=} opt_callback
+ * @param {boolean=} opt_exact Expect an exact match; defaults to false.
*/
- expectSpeechAfter: function(expectedText, opt_callback) {
+ expectSpeechAfter: function(expectedText, opt_callback, opt_exact) {
var expectation = {};
if (this.expectations_.length == 0 && opt_callback)
opt_callback();
else
expectation.startCallback = opt_callback;
- this.addExpectation_(expectedText, expectation);
+ this.addExpectation_(expectedText, expectation, opt_exact);
},
/**
@@ -71,11 +72,14 @@ MockTts.prototype = {
* @param {string} expectedText Text expected spoken.
* @param {{startCallback: function() : void,
* endCallback: function() : void}=} opt_expectation
+ * @param {boolean=} opt_exact Expects an exact match.
*/
- addExpectation_: function(expectedText, opt_expectation) {
+ addExpectation_: function(expectedText, opt_expectation, opt_exact) {
var expectation = opt_expectation ? opt_expectation : {};
expectation.predicate = function(actualText) {
+ if (opt_exact)
+ return actualText === expectedText;
return actualText.indexOf(expectedText) != -1;
};
« no previous file with comments | « chrome/browser/resources/chromeos/chromevox/manifest.json.jinja2 ('k') | chrome/common/extensions/command.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698