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

Unified Diff: chrome/browser/resources/chromeos/chromevox/host/chrome/tts_background_test.extjs

Issue 2387413002: Improve speech contextual announcements and startCallback synchronization (Closed)
Patch Set: Disable test; it lonly works if you have Google tts installed locally. Created 4 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/host/chrome/tts_background_test.extjs
diff --git a/chrome/browser/resources/chromeos/chromevox/host/chrome/tts_background_test.extjs b/chrome/browser/resources/chromeos/chromevox/host/chrome/tts_background_test.extjs
index dda509d730e9c3357ae98e505654697d47e0186b..ad39fd5002359f9de9fe762f9f160dba7b134811 100644
--- a/chrome/browser/resources/chromeos/chromevox/host/chrome/tts_background_test.extjs
+++ b/chrome/browser/resources/chromeos/chromevox/host/chrome/tts_background_test.extjs
@@ -72,22 +72,23 @@ SYNC_TEST_F('CvoxTtsBackgroundTest', 'UpdateVoice', function() {
assertEquals('French', tts.currentVoice);
});
-SYNC_TEST_F('CvoxTtsBackgroundTest', 'EmptyStringCallsCallbacks', function() {
+// This test only works if Google tts is installed. Run it locally.
+TEST_F(
+ 'CvoxTtsBackgroundTest', 'DISABLED_EmptyStringCallsCallbacks', function() {
var tts = new cvox.TtsBackground(false);
- chrome.tts.speak = assertNotReached.bind(
- null, 'chrome.tts.speak shouldn\t be called.');
-
- assertCallsCallbacks = function(text) {
- var startCalls = 0;
- var endCalls = 0;
+ var startCalls = 0, endCalls = 0;
+ assertCallsCallbacks = function(text, speakCalls) {
tts.speak(text, cvox.QueueMode.QUEUE,
{startCallback: function() { ++startCalls; },
- endCallback: function() { ++endCalls; }});
- assertEquals(1, startCalls, text);
- assertEquals(1, endCalls, text);
+ endCallback: this.newCallback(function() {
+ ++endCalls;
+ assertEquals(speakCalls, endCalls);
+ assertEquals(endCalls, startCalls);
+ })}
+ );
}.bind(this);
- assertCallsCallbacks('');
- assertCallsCallbacks(' ');
- assertCallsCallbacks(' \u00a0 ');
+ assertCallsCallbacks('', 1);
+ assertCallsCallbacks(' ', 2);
+ assertCallsCallbacks(' \u00a0 ', 3);
});

Powered by Google App Engine
This is Rietveld 408576698