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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // TTS api test for Chrome on ChromeOS.
6 // browser_tests.exe --gtest_filter="TtsApiTest.*"
7
8 chrome.test.runTests([
9 function testWordCallbacks() {
10 // Register listeners for speech functions, enabling this extension
11 // to be a TTS engine.
12 var speakListener = function(utterance, options, sendTtsEvent) {
13 chrome.test.assertNoLastError();
14 sendTtsEvent({'type': 'end', 'charIndex': utterance.length});
15 };
16 var stopListener = function() {};
17 chrome.ttsEngine.onSpeak.addListener(speakListener);
18 chrome.ttsEngine.onStop.addListener(stopListener);
19
20 // Make sure that a lang of 'fr-FR' goes to our engine,
21 // even though the engine only registered 'fr'.
22 chrome.tts.speak(
23 'dummy utterance',
24 {
25 'lang': 'fr-FR',
26 'onEvent': function(event) {
27 chrome.test.assertNoLastError();
28 chrome.test.succeed();
29 }
30 },
31 function() {
32 chrome.test.assertNoLastError();
33 });
34 }
35 ]);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698