| 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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 audio_manager_.reset(new media::MockAudioManager( | 126 audio_manager_.reset(new media::MockAudioManager( |
| 127 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO))); | 127 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO))); |
| 128 audio_manager_->SetInputStreamParameters( | 128 audio_manager_->SetInputStreamParameters( |
| 129 media::AudioParameters::UnavailableDeviceParams()); | 129 media::AudioParameters::UnavailableDeviceParams()); |
| 130 audio_system_ = media::AudioSystemImpl::Create(audio_manager_.get()); | 130 audio_system_ = media::AudioSystemImpl::Create(audio_manager_.get()); |
| 131 SpeechRecognizerImpl::SetAudioSystemForTesting(audio_system_.get()); | 131 SpeechRecognizerImpl::SetAudioSystemForTesting(audio_system_.get()); |
| 132 } | 132 } |
| 133 | 133 |
| 134 void TearDownOnMainThread() override { | 134 void TearDownOnMainThread() override { |
| 135 SpeechRecognizerImpl::SetAudioSystemForTesting(nullptr); | 135 SpeechRecognizerImpl::SetAudioSystemForTesting(nullptr); |
| 136 |
| 137 // Deleting AudioManager on audio thread, |
| 138 audio_system_.reset(); |
| 139 audio_manager_.reset(); |
| 136 } | 140 } |
| 137 | 141 |
| 138 void TearDownInProcessBrowserTestFixture() override { | 142 void TearDownInProcessBrowserTestFixture() override { |
| 139 test_audio_input_controller_factory_.set_delegate(nullptr); | 143 test_audio_input_controller_factory_.set_delegate(nullptr); |
| 140 mock_streaming_server_.reset(); | 144 mock_streaming_server_.reset(); |
| 141 } | 145 } |
| 142 | 146 |
| 143 private: | 147 private: |
| 144 static void FeedSingleBufferToAudioController( | 148 static void FeedSingleBufferToAudioController( |
| 145 scoped_refptr<media::TestAudioInputController> controller, | 149 scoped_refptr<media::TestAudioInputController> controller, |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 | 218 |
| 215 IN_PROC_BROWSER_TEST_F(SpeechRecognitionBrowserTest, OneShotRecognition) { | 219 IN_PROC_BROWSER_TEST_F(SpeechRecognitionBrowserTest, OneShotRecognition) { |
| 216 NavigateToURLBlockUntilNavigationsComplete( | 220 NavigateToURLBlockUntilNavigationsComplete( |
| 217 shell(), GetTestUrlFromFragment("oneshot"), 2); | 221 shell(), GetTestUrlFromFragment("oneshot"), 2); |
| 218 | 222 |
| 219 EXPECT_EQ(kClientDisconnected, streaming_server_state()); | 223 EXPECT_EQ(kClientDisconnected, streaming_server_state()); |
| 220 EXPECT_EQ("goodresult1", GetPageFragment()); | 224 EXPECT_EQ("goodresult1", GetPageFragment()); |
| 221 } | 225 } |
| 222 | 226 |
| 223 } // namespace content | 227 } // namespace content |
| OLD | NEW |