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

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

Issue 845693004: Initial implementation of continuous read for ChromeVox Next. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove e2e test. Created 5 years, 11 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
« no previous file with comments | « chrome/browser/resources/chromeos/chromevox/manifest.json.jinja2 ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 b41c0ad345f499e220b028cafba498ac10a57d31..0915e1120218ccf763628557b16e296418f22ab2 100644
--- a/chrome/browser/resources/chromeos/chromevox/testing/mock_tts.js
+++ b/chrome/browser/resources/chromeos/chromevox/testing/mock_tts.js
@@ -8,6 +8,11 @@
* @extends {cvox.TtsInterface}
*/
var MockTts = function() {
+ /**
+ * The event handler for the most recent call to |speak|.
+ * @private
+ */
+ this.onEvent_;
};
MockTts.prototype = {
@@ -29,6 +34,9 @@ MockTts.prototype = {
/** @override */
speak: function(textString, queueMode, properties) {
+ if (properties)
+ this.onEvent_ = properties['onEvent'];
+
this.process_(textString);
},
@@ -69,6 +77,22 @@ MockTts.prototype = {
},
/**
+ * Fakes an event to |onEvent|.
+ */
+ sendStartEvent: function() {
+ if (this.onEvent_)
+ this.onEvent_({type: 'start'});
+ },
+
+ /**
+ * Fakes an event to |onEvent|.
+ */
+ sendEndEvent: function() {
+ if (this.onEvent_)
+ this.onEvent_({type: 'end'});
+ },
+
+ /**
* @private
* @param {string} expectedText Text expected spoken.
* @param {{startCallback: function() : void,
« no previous file with comments | « chrome/browser/resources/chromeos/chromevox/manifest.json.jinja2 ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698