Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(94)

Side by Side Diff: content/browser/speech/speech_recognition_browsertest.cc

Issue 2077983003: Intiialize AudioManager and related class lazily (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix MediaSessionTest Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 void SetUpInProcessBrowserTestFixture() override { 113 void SetUpInProcessBrowserTestFixture() override {
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(
124 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO));
123 SpeechRecognizerImpl::SetAudioManagerForTesting( 125 SpeechRecognizerImpl::SetAudioManagerForTesting(
124 new media::MockAudioManager(BrowserThread::GetMessageLoopProxyForThread( 126 new media::MockAudioManager(BrowserThread::GetMessageLoopProxyForThread(
125 BrowserThread::IO))); 127 BrowserThread::IO)));
126 } 128 }
127 129
128 void TearDownOnMainThread() override { 130 void TearDownOnMainThread() override {
129 SpeechRecognizerImpl::SetAudioManagerForTesting(NULL); 131 SpeechRecognizerImpl::SetAudioManagerForTesting(NULL);
130 } 132 }
131 133
132 void TearDownInProcessBrowserTestFixture() override { 134 void TearDownInProcessBrowserTestFixture() override {
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 208
207 IN_PROC_BROWSER_TEST_F(SpeechRecognitionBrowserTest, OneShotRecognition) { 209 IN_PROC_BROWSER_TEST_F(SpeechRecognitionBrowserTest, OneShotRecognition) {
208 NavigateToURLBlockUntilNavigationsComplete( 210 NavigateToURLBlockUntilNavigationsComplete(
209 shell(), GetTestUrlFromFragment("oneshot"), 2); 211 shell(), GetTestUrlFromFragment("oneshot"), 2);
210 212
211 EXPECT_EQ(kClientDisconnected, streaming_server_state()); 213 EXPECT_EQ(kClientDisconnected, streaming_server_state());
212 EXPECT_EQ("goodresult1", GetPageFragment()); 214 EXPECT_EQ("goodresult1", GetPageFragment());
213 } 215 }
214 216
215 } // namespace content 217 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_process_host_impl.cc ('k') | media/audio/android/audio_manager_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698