| 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 testNoListeners() { | 9 function testNoListeners() { |
| 10 // This call should go to native speech because we haven't registered | 10 // This call should go to native speech because we haven't registered |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 if (event.type == 'end') { | 81 if (event.type == 'end') { |
| 82 callbacks++; | 82 callbacks++; |
| 83 } | 83 } |
| 84 } | 84 } |
| 85 }, function() { | 85 }, function() { |
| 86 chrome.test.assertNoLastError(); | 86 chrome.test.assertNoLastError(); |
| 87 }); | 87 }); |
| 88 chrome.tts.speak( | 88 chrome.tts.speak( |
| 89 'native speech 3', | 89 'native speech 3', |
| 90 { | 90 { |
| 91 'voiceName': 'French', |
| 91 'lang': 'fr-FR', | 92 'lang': 'fr-FR', |
| 92 'enqueue': true, | 93 'enqueue': true, |
| 93 'onEvent': function(event) { | 94 'onEvent': function(event) { |
| 94 if (event.type == 'end') { | 95 if (event.type == 'end') { |
| 95 callbacks++; | 96 callbacks++; |
| 96 } | 97 } |
| 97 } | 98 } |
| 98 }, function() { | 99 }, function() { |
| 99 chrome.test.assertNoLastError(); | 100 chrome.test.assertNoLastError(); |
| 100 }); | 101 }); |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 chrome.test.assertEq('Alice', voices[1].voiceName); | 156 chrome.test.assertEq('Alice', voices[1].voiceName); |
| 156 chrome.test.assertEq('en-US', voices[1].lang); | 157 chrome.test.assertEq('en-US', voices[1].lang); |
| 157 chrome.test.assertEq('female', voices[1].gender); | 158 chrome.test.assertEq('female', voices[1].gender); |
| 158 | 159 |
| 159 chrome.test.assertEq('Pat', voices[2].voiceName); | 160 chrome.test.assertEq('Pat', voices[2].voiceName); |
| 160 chrome.test.assertEq('en-US', voices[2].lang); | 161 chrome.test.assertEq('en-US', voices[2].lang); |
| 161 chrome.test.succeed(); | 162 chrome.test.succeed(); |
| 162 }); | 163 }); |
| 163 } | 164 } |
| 164 ]); | 165 ]); |
| OLD | NEW |