OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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. This is currently limited to ChromeOS. | 5 // TTS api test for Chrome on ChromeOS. |
6 // browser_tests.exe --gtest_filter=ExtensionApiTest.Tts | 6 // browser_tests.exe --gtest_filter=ExtensionApiTest.TtsOnChromeOs |
7 | 7 |
8 chrome.test.runTests([ | 8 chrome.test.runTests([ |
9 function testSpeak() { | 9 function testSpeak() { |
10 chrome.experimental.tts.speak('hello world', {}, function() { | 10 chrome.experimental.tts.speak('hello world', {}, function() { |
11 chrome.test.succeed(); | 11 chrome.test.succeed(); |
12 }); | 12 }); |
13 }, | 13 }, |
14 | 14 |
15 function testStop() { | 15 function testStop() { |
16 chrome.experimental.tts.stop(); | 16 chrome.experimental.tts.stop(); |
17 chrome.test.succeed(); | 17 chrome.test.succeed(); |
18 }, | 18 }, |
19 | 19 |
20 function testIsSpeaking() { | 20 function testIsSpeaking() { |
21 for (var i = 0; i < 3; i++) { | 21 for (var i = 0; i < 3; i++) { |
22 chrome.experimental.tts.isSpeaking(function(speaking) { | 22 chrome.experimental.tts.isSpeaking(function(speaking) { |
23 chrome.test.assertTrue(speaking); | 23 chrome.test.assertTrue(speaking); |
24 }); | 24 }); |
25 } | 25 } |
26 chrome.experimental.tts.isSpeaking(function(speaking) { | 26 chrome.experimental.tts.isSpeaking(function(speaking) { |
27 chrome.test.assertFalse(speaking); | 27 chrome.test.assertFalse(speaking); |
28 chrome.test.succeed(); | 28 chrome.test.succeed(); |
29 }); | 29 }); |
30 } | 30 } |
31 ]); | 31 ]); |
OLD | NEW |