OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include <stddef.h> | 5 #include <stddef.h> |
6 #include <stdint.h> | 6 #include <stdint.h> |
7 #include <string.h> | 7 #include <string.h> |
8 | 8 |
9 #include <list> | 9 #include <list> |
10 #include <memory> | 10 #include <memory> |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 } | 192 } |
193 | 193 |
194 SpeechRecognitionResult GetGoodSpeechResult() { | 194 SpeechRecognitionResult GetGoodSpeechResult() { |
195 SpeechRecognitionResult result; | 195 SpeechRecognitionResult result; |
196 result.hypotheses.push_back(SpeechRecognitionHypothesis( | 196 result.hypotheses.push_back(SpeechRecognitionHypothesis( |
197 base::UTF8ToUTF16("Pictures of the moon"), 1.0F)); | 197 base::UTF8ToUTF16("Pictures of the moon"), 1.0F)); |
198 return result; | 198 return result; |
199 } | 199 } |
200 | 200 |
201 media::MockAudioManager::UniquePtr audio_manager_; | 201 media::MockAudioManager::UniquePtr audio_manager_; |
202 std::unique_ptr<media::AudioSystem> audio_system_; | 202 media::AudioSystem::UniquePtr audio_system_; |
203 StreamingServerState streaming_server_state_; | 203 StreamingServerState streaming_server_state_; |
204 std::unique_ptr<MockGoogleStreamingServer> mock_streaming_server_; | 204 std::unique_ptr<MockGoogleStreamingServer> mock_streaming_server_; |
205 media::TestAudioInputControllerFactory test_audio_input_controller_factory_; | 205 media::TestAudioInputControllerFactory test_audio_input_controller_factory_; |
206 }; | 206 }; |
207 | 207 |
208 // Simply loads the test page and checks if it was able to create a Speech | 208 // Simply loads the test page and checks if it was able to create a Speech |
209 // Recognition object in JavaScript, to make sure the Web Speech API is enabled. | 209 // Recognition object in JavaScript, to make sure the Web Speech API is enabled. |
210 // Flaky on all platforms. http://crbug.com/396414. | 210 // Flaky on all platforms. http://crbug.com/396414. |
211 IN_PROC_BROWSER_TEST_F(SpeechRecognitionBrowserTest, DISABLED_Precheck) { | 211 IN_PROC_BROWSER_TEST_F(SpeechRecognitionBrowserTest, DISABLED_Precheck) { |
212 NavigateToURLBlockUntilNavigationsComplete( | 212 NavigateToURLBlockUntilNavigationsComplete( |
213 shell(), GetTestUrlFromFragment("precheck"), 2); | 213 shell(), GetTestUrlFromFragment("precheck"), 2); |
214 | 214 |
215 EXPECT_EQ(kIdle, streaming_server_state()); | 215 EXPECT_EQ(kIdle, streaming_server_state()); |
216 EXPECT_EQ("success", GetPageFragment()); | 216 EXPECT_EQ("success", GetPageFragment()); |
217 } | 217 } |
218 | 218 |
219 IN_PROC_BROWSER_TEST_F(SpeechRecognitionBrowserTest, OneShotRecognition) { | 219 IN_PROC_BROWSER_TEST_F(SpeechRecognitionBrowserTest, OneShotRecognition) { |
220 NavigateToURLBlockUntilNavigationsComplete( | 220 NavigateToURLBlockUntilNavigationsComplete( |
221 shell(), GetTestUrlFromFragment("oneshot"), 2); | 221 shell(), GetTestUrlFromFragment("oneshot"), 2); |
222 | 222 |
223 EXPECT_EQ(kClientDisconnected, streaming_server_state()); | 223 EXPECT_EQ(kClientDisconnected, streaming_server_state()); |
224 EXPECT_EQ("goodresult1", GetPageFragment()); | 224 EXPECT_EQ("goodresult1", GetPageFragment()); |
225 } | 225 } |
226 | 226 |
227 } // namespace content | 227 } // namespace content |
OLD | NEW |