Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(36)

Side by Side Diff: chrome/test/data/extensions/api_test/tts/optional_args/test.js

Issue 7258007: Move the tts and ttsEngine APIs out of experimental, and give (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 // browser_tests.exe --gtest_filter="TtsApiTest.*" 5 // browser_tests.exe --gtest_filter="TtsApiTest.*"
6 6
7 chrome.test.runTests([ 7 chrome.test.runTests([
8 function testSpeakWithOptionalArgs() { 8 function testSpeakWithOptionalArgs() {
9 // This will fail. 9 // This will fail.
10 try { 10 try {
11 chrome.experimental.tts.speak(); 11 chrome.tts.speak();
12 chrome.test.fail(); 12 chrome.test.fail();
13 } catch (e) { 13 } catch (e) {
14 } 14 }
15 15
16 // This will succeed but nothing will be spoken. 16 // This will succeed but nothing will be spoken.
17 chrome.experimental.tts.speak(''); 17 chrome.tts.speak('');
18 18
19 // This will succeed. 19 // This will succeed.
20 chrome.experimental.tts.speak('Alpha'); 20 chrome.tts.speak('Alpha');
21 21
22 // This will fail. 22 // This will fail.
23 try { 23 try {
24 chrome.experimental.tts.speak(null); 24 chrome.tts.speak(null);
25 chrome.test.fail(); 25 chrome.test.fail();
26 } catch (e) { 26 } catch (e) {
27 } 27 }
28 28
29 // This will succeed. 29 // This will succeed.
30 chrome.experimental.tts.speak('Bravo', {}); 30 chrome.tts.speak('Bravo', {});
31 31
32 // This will succeed. 32 // This will succeed.
33 chrome.experimental.tts.speak('Charlie', null); 33 chrome.tts.speak('Charlie', null);
34 34
35 // This will fail. 35 // This will fail.
36 try { 36 try {
37 chrome.experimental.tts.speak('Delta', 'foo'); 37 chrome.tts.speak('Delta', 'foo');
38 chrome.test.fail(); 38 chrome.test.fail();
39 } catch (e) { 39 } catch (e) {
40 } 40 }
41 41
42 // This will succeed. 42 // This will succeed.
43 chrome.experimental.tts.speak('Echo', {}, function() {}); 43 chrome.tts.speak('Echo', {}, function() {});
44 44
45 // This will fail. 45 // This will fail.
46 try { 46 try {
47 chrome.experimental.tts.speak('Foxtrot', {}, 'foo'); 47 chrome.tts.speak('Foxtrot', {}, 'foo');
48 chrome.test.fail(); 48 chrome.test.fail();
49 } catch (e) { 49 } catch (e) {
50 } 50 }
51 51
52 chrome.test.succeed(); 52 chrome.test.succeed();
53 } 53 }
54 ]); 54 ]);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698