| 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="TtsApiTest.*" | 6 // browser_tests.exe --gtest_filter="TtsApiTest.*" |
| 7 | 7 |
| 8 chrome.test.runTests([ | 8 chrome.test.runTests([ |
| 9 function testQueueInterrupt() { | 9 function testQueueInterrupt() { |
| 10 // In this test, two utterances are queued, and then a third | 10 // In this test, two utterances are queued, and then a third |
| 11 // interrupts. The first gets interrupted, the second never gets spoken | 11 // interrupts. The first gets interrupted, the second never gets spoken |
| 12 // at all. The test expectations in extension_tts_apitest.cc ensure that | 12 // at all. The test expectations in tts_extension_apitest.cc ensure that |
| 13 // the first call to tts.speak keeps going until it's interrupted. | 13 // the first call to tts.speak keeps going until it's interrupted. |
| 14 var callbacks = 0; | 14 var callbacks = 0; |
| 15 chrome.tts.speak( | 15 chrome.tts.speak( |
| 16 'text 1', | 16 'text 1', |
| 17 { | 17 { |
| 18 'enqueue': true, | 18 'enqueue': true, |
| 19 'onEvent': function(event) { | 19 'onEvent': function(event) { |
| 20 chrome.test.assertEq('interrupted', event.type); | 20 chrome.test.assertEq('interrupted', event.type); |
| 21 callbacks++; | 21 callbacks++; |
| 22 } | 22 } |
| (...skipping 27 matching lines...) Expand all Loading... |
| 50 chrome.test.fail(); | 50 chrome.test.fail(); |
| 51 } | 51 } |
| 52 } | 52 } |
| 53 }, | 53 }, |
| 54 function() { | 54 function() { |
| 55 chrome.test.assertNoLastError(); | 55 chrome.test.assertNoLastError(); |
| 56 callbacks++; | 56 callbacks++; |
| 57 }); | 57 }); |
| 58 } | 58 } |
| 59 ]); | 59 ]); |
| OLD | NEW |