Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / chrome / test / data / extensions / api_test / tts_engine / lang_matching / test.js
blobe2845b246c36e6cb2d8b70b0429c306288dc59dc
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.*"
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});
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'.
22 chrome.tts.speak(
23 'dummy utterance',
25 'lang': 'fr-FR',
26 'onEvent': function(event) {
27 chrome.test.assertNoLastError();
28 chrome.test.succeed();
31 function() {
32 chrome.test.assertNoLastError();
33 });
35 ]);