1 // Copyright (c) 2012 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.
5 // TTS api test for Chrome on ChromeOS.
6 // browser_tests.exe --gtest_filter="TtsApiTest.*"
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});
16 var stopListener = function() {};
17 chrome.ttsEngine.onSpeak.addListener(speakListener);
18 chrome.ttsEngine.onStop.addListener(stopListener);
20 // Make sure that a lang of 'fr-FR' goes to our engine,
21 // even though the engine only registered 'fr'.
26 'onEvent': function(event) {
27 chrome.test.assertNoLastError();
28 chrome.test.succeed();
32 chrome.test.assertNoLastError();