OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // TTS api test for Chrome on ChromeOS. | 5 // TTS api test for Chrome on ChromeOS. |
6 // browser_tests.exe --gtest_filter="ExtensionApiTest.TtsChromeOs" | 6 // browser_tests.exe --gtest_filter="ExtensionApiTest.TtsChromeOs" |
7 | 7 |
8 chrome.test.runTests([ | 8 chrome.test.runTests([ |
9 function testChromeOsSpeech() { | 9 function testChromeOsSpeech() { |
10 var callbacks = 0; | 10 var callbacks = 0; |
11 chrome.experimental.tts.speak( | 11 chrome.experimental.tts.speak( |
12 'text 1', | 12 'text 1', |
13 { | 13 { |
14 'onevent': function(event) { | 14 'onEvent': function(event) { |
15 callbacks++; | 15 callbacks++; |
16 chrome.test.assertEq('interrupted', event.type); | 16 chrome.test.assertEq('interrupted', event.type); |
17 } | 17 } |
18 }, | 18 }, |
19 function() { | 19 function() { |
20 chrome.test.assertNoLastError(); | 20 chrome.test.assertNoLastError(); |
21 }); | 21 }); |
22 chrome.experimental.tts.speak( | 22 chrome.experimental.tts.speak( |
23 'text 2', | 23 'text 2', |
24 { | 24 { |
25 'onevent': function(event) { | 25 'onEvent': function(event) { |
26 chrome.test.assertEq('end', event.type); | 26 chrome.test.assertEq('end', event.type); |
27 callbacks++; | 27 callbacks++; |
28 if (callbacks == 2) { | 28 if (callbacks == 2) { |
29 chrome.test.succeed(); | 29 chrome.test.succeed(); |
30 } else { | 30 } else { |
31 chrome.test.fail(); | 31 chrome.test.fail(); |
32 } | 32 } |
33 } | 33 } |
34 }, | 34 }, |
35 function() { | 35 function() { |
36 chrome.test.assertNoLastError(); | 36 chrome.test.assertNoLastError(); |
37 }); | 37 }); |
38 } | 38 } |
39 | 39 |
40 ]); | 40 ]); |
OLD | NEW |