| 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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 test_audio_input_controller_factory_.set_delegate(this); | 114 test_audio_input_controller_factory_.set_delegate(this); |
| 115 media::AudioInputController::set_factory_for_testing( | 115 media::AudioInputController::set_factory_for_testing( |
| 116 &test_audio_input_controller_factory_); | 116 &test_audio_input_controller_factory_); |
| 117 mock_streaming_server_.reset(new MockGoogleStreamingServer(this)); | 117 mock_streaming_server_.reset(new MockGoogleStreamingServer(this)); |
| 118 streaming_server_state_ = kIdle; | 118 streaming_server_state_ = kIdle; |
| 119 } | 119 } |
| 120 | 120 |
| 121 void SetUpOnMainThread() override { | 121 void SetUpOnMainThread() override { |
| 122 ASSERT_TRUE(SpeechRecognitionManagerImpl::GetInstance()); | 122 ASSERT_TRUE(SpeechRecognitionManagerImpl::GetInstance()); |
| 123 media::AudioManager::StartHangMonitorIfNeeded( | 123 media::AudioManager::StartHangMonitorIfNeeded( |
| 124 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); | 124 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO)); |
| 125 SpeechRecognizerImpl::SetAudioManagerForTesting( | 125 SpeechRecognizerImpl::SetAudioManagerForTesting(new media::MockAudioManager( |
| 126 new media::MockAudioManager(BrowserThread::GetMessageLoopProxyForThread( | 126 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO))); |
| 127 BrowserThread::IO))); | |
| 128 } | 127 } |
| 129 | 128 |
| 130 void TearDownOnMainThread() override { | 129 void TearDownOnMainThread() override { |
| 131 SpeechRecognizerImpl::SetAudioManagerForTesting(NULL); | 130 SpeechRecognizerImpl::SetAudioManagerForTesting(NULL); |
| 132 } | 131 } |
| 133 | 132 |
| 134 void TearDownInProcessBrowserTestFixture() override { | 133 void TearDownInProcessBrowserTestFixture() override { |
| 135 test_audio_input_controller_factory_.set_delegate(NULL); | 134 test_audio_input_controller_factory_.set_delegate(NULL); |
| 136 mock_streaming_server_.reset(); | 135 mock_streaming_server_.reset(); |
| 137 } | 136 } |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 | 207 |
| 209 IN_PROC_BROWSER_TEST_F(SpeechRecognitionBrowserTest, OneShotRecognition) { | 208 IN_PROC_BROWSER_TEST_F(SpeechRecognitionBrowserTest, OneShotRecognition) { |
| 210 NavigateToURLBlockUntilNavigationsComplete( | 209 NavigateToURLBlockUntilNavigationsComplete( |
| 211 shell(), GetTestUrlFromFragment("oneshot"), 2); | 210 shell(), GetTestUrlFromFragment("oneshot"), 2); |
| 212 | 211 |
| 213 EXPECT_EQ(kClientDisconnected, streaming_server_state()); | 212 EXPECT_EQ(kClientDisconnected, streaming_server_state()); |
| 214 EXPECT_EQ("goodresult1", GetPageFragment()); | 213 EXPECT_EQ("goodresult1", GetPageFragment()); |
| 215 } | 214 } |
| 216 | 215 |
| 217 } // namespace content | 216 } // namespace content |
| OLD | NEW |