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

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

Issue 7282048: Update TTS extension API docs to reflect latest changes. Note that this (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 // TTS api test for Chrome on ChromeOS. 5 // TTS api test for Chrome on ChromeOS.
6 // browser_tests.exe --gtest_filter="TtsApiTest.*" 6 // browser_tests.exe --gtest_filter="TtsApiTest.*"
7 7
8 chrome.test.runTests([ 8 chrome.test.runTests([
9 function testWordCallbacks() { 9 function testWordCallbacks() {
10 var callbacks = 0; 10 var callbacks = 0;
11 chrome.experimental.tts.speak( 11 chrome.experimental.tts.speak(
12 'one two three', 12 'one two three',
13 { 13 {
14 'onevent': function(event) { 14 'onEvent': function(event) {
15 callbacks++; 15 callbacks++;
16 switch(callbacks) { 16 switch(callbacks) {
17 case 1: 17 case 1:
18 chrome.test.assertEq('word', event.type); 18 chrome.test.assertEq('word', event.type);
19 chrome.test.assertEq(0, event.charIndex); 19 chrome.test.assertEq(0, event.charIndex);
20 break; 20 break;
21 case 2: 21 case 2:
22 chrome.test.assertEq('word', event.type); 22 chrome.test.assertEq('word', event.type);
23 chrome.test.assertEq(4, event.charIndex); 23 chrome.test.assertEq(4, event.charIndex);
24 break; 24 break;
25 case 3: 25 case 3:
26 chrome.test.assertEq('word', event.type); 26 chrome.test.assertEq('word', event.type);
27 chrome.test.assertEq(8, event.charIndex); 27 chrome.test.assertEq(8, event.charIndex);
28 break; 28 break;
29 case 4: 29 case 4:
30 chrome.test.assertEq('end', event.type); 30 chrome.test.assertEq('end', event.type);
31 chrome.test.assertEq(13, event.charIndex); 31 chrome.test.assertEq(13, event.charIndex);
32 chrome.test.succeed(); 32 chrome.test.succeed();
33 break; 33 break;
34 default: 34 default:
35 chrome.test.fail(); 35 chrome.test.fail();
36 } 36 }
37 } 37 }
38 }); 38 });
39 } 39 }
40 ]); 40 ]);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698