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

Unified Diff: chrome/test/data/extensions/api_test/tts_engine/lang_matching/test.js

Issue 10581011: Fix TTS extension API language matching. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 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/test/data/extensions/api_test/tts_engine/lang_matching/test.js
diff --git a/chrome/test/data/extensions/api_test/tts_engine/lang_matching/test.js b/chrome/test/data/extensions/api_test/tts_engine/lang_matching/test.js
new file mode 100644
index 0000000000000000000000000000000000000000..e2495183e20e8f893a70fc636212c2b6d5d77540
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/tts_engine/lang_matching/test.js
@@ -0,0 +1,35 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// TTS api test for Chrome on ChromeOS.
+// browser_tests.exe --gtest_filter="TtsApiTest.*"
+
+chrome.test.runTests([
+ function testWordCallbacks() {
+ // Register listeners for speech functions, enabling this extension
+ // to be a TTS engine.
+ var speakListener = function(utterance, options, sendTtsEvent) {
+ chrome.test.assertNoLastError();
+ sendTtsEvent({'type': 'end', 'charIndex': utterance.length});
+ };
+ var stopListener = function() {};
+ chrome.ttsEngine.onSpeak.addListener(speakListener);
+ chrome.ttsEngine.onStop.addListener(stopListener);
+
+ // Make sure that a lang of 'fr-FR' goes to our engine,
+ // even though the engine only registered 'fr'.
+ chrome.tts.speak(
+ 'dummy utterance',
+ {
+ 'lang': 'fr-FR',
+ 'onEvent': function(event) {
+ chrome.test.assertNoLastError();
+ chrome.test.succeed();
+ }
+ },
+ function() {
+ chrome.test.assertNoLastError();
+ });
+ }
+]);

Powered by Google App Engine
This is Rietveld 408576698