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 / speak_error / test.js
blob8ab916546e76caee2e6e6b627b05d1fd4b0fe571
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.
5 // TTS api test for Chrome on ChromeOS.
6 // browser_tests.exe --gtest_filter="TtsApiTest.*"
8 chrome.test.runTests([
9 function testSpeakError() {
10 var callbacks = 0;
11 chrome.tts.speak(
12 'first try',
14 'enqueue': true,
15 'onEvent': function(event) {
16 chrome.test.assertEq('error', event.type);
17 chrome.test.assertEq('epic fail', event.errorMessage);
18 callbacks++;
21 function() {
22 chrome.test.assertNoLastError();
23 });
24 chrome.tts.speak(
25 'second try',
27 'enqueue': true,
28 'onEvent': function(event) {
29 chrome.test.assertEq('end', event.type);
30 callbacks++;
31 if (callbacks == 2) {
32 chrome.test.succeed();
33 } else {
34 chrome.test.fail();
38 function() {
39 chrome.test.assertNoLastError();
40 });
42 ]);