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

Side by Side Diff: chrome/test/data/extensions/api_test/tts/enqueue/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 testEnqueue() { 9 function testEnqueue() {
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 'enqueue': true, 14 'enqueue': true,
15 'onevent': function(event) { 15 'onEvent': function(event) {
16 chrome.test.assertEq('end', event.type); 16 chrome.test.assertEq('end', event.type);
17 callbacks++; 17 callbacks++;
18 } 18 }
19 }, 19 },
20 function() { 20 function() {
21 chrome.test.assertNoLastError(); 21 chrome.test.assertNoLastError();
22 callbacks++; 22 callbacks++;
23 }); 23 });
24 chrome.experimental.tts.speak( 24 chrome.experimental.tts.speak(
25 'text 2', 25 'text 2',
26 { 26 {
27 'enqueue': true, 27 'enqueue': true,
28 'onevent': function(event) { 28 'onEvent': function(event) {
29 chrome.test.assertEq('end', event.type); 29 chrome.test.assertEq('end', event.type);
30 callbacks++; 30 callbacks++;
31 if (callbacks == 4) { 31 if (callbacks == 4) {
32 chrome.test.succeed(); 32 chrome.test.succeed();
33 } else { 33 } else {
34 chrome.test.fail(); 34 chrome.test.fail();
35 } 35 }
36 } 36 }
37 }, 37 },
38 function() { 38 function() {
39 chrome.test.assertNoLastError(); 39 chrome.test.assertNoLastError();
40 callbacks++; 40 callbacks++;
41 }); 41 });
42 } 42 }
43 ]); 43 ]);
OLDNEW
« no previous file with comments | « chrome/test/data/extensions/api_test/tts/chromeos/test.js ('k') | chrome/test/data/extensions/api_test/tts/interrupt/test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698