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

Side by Side Diff: content/test/webrtc_audio_device_test.cc

Issue 9805001: Move media/audio files into media namespace (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix various compiler errors Created 8 years, 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/test/webrtc_audio_device_test.h" 5 #include "content/test/webrtc_audio_device_test.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 157
158 void WebRTCAudioDeviceTest::InitializeIOThread(const char* thread_name) { 158 void WebRTCAudioDeviceTest::InitializeIOThread(const char* thread_name) {
159 // We initialize COM (STA) on our IO thread as is done in Chrome. 159 // We initialize COM (STA) on our IO thread as is done in Chrome.
160 // See BrowserProcessSubThread::Init. 160 // See BrowserProcessSubThread::Init.
161 initialize_com_.reset(new ScopedCOMInitializer()); 161 initialize_com_.reset(new ScopedCOMInitializer());
162 162
163 // Set the current thread as the IO thread. 163 // Set the current thread as the IO thread.
164 io_thread_.reset(new content::TestBrowserThread(content::BrowserThread::IO, 164 io_thread_.reset(new content::TestBrowserThread(content::BrowserThread::IO,
165 MessageLoop::current())); 165 MessageLoop::current()));
166 166
167 audio_manager_.reset(AudioManager::Create()); 167 audio_manager_.reset(media::AudioManager::Create());
168 168
169 // Populate our resource context. 169 // Populate our resource context.
170 test_request_context_ = new TestURLRequestContext(); 170 test_request_context_ = new TestURLRequestContext();
171 resource_context_->set_request_context(test_request_context_.get()); 171 resource_context_->set_request_context(test_request_context_.get());
172 media_observer_.reset(new MockMediaObserver()); 172 media_observer_.reset(new MockMediaObserver());
173 resource_context_->set_media_observer(media_observer_.get()); 173 resource_context_->set_media_observer(media_observer_.get());
174 174
175 // Create an IPC channel that handles incoming messages on the IO thread. 175 // Create an IPC channel that handles incoming messages on the IO thread.
176 CreateChannel(thread_name); 176 CreateChannel(thread_name);
177 } 177 }
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 void WebRTCAudioDeviceTest::OnGetHardwareSampleRate(int* sample_rate) { 215 void WebRTCAudioDeviceTest::OnGetHardwareSampleRate(int* sample_rate) {
216 EXPECT_TRUE(audio_util_callback_); 216 EXPECT_TRUE(audio_util_callback_);
217 *sample_rate = audio_util_callback_ ? 217 *sample_rate = audio_util_callback_ ?
218 audio_util_callback_->GetAudioHardwareSampleRate() : 0; 218 audio_util_callback_->GetAudioHardwareSampleRate() : 0;
219 } 219 }
220 220
221 void WebRTCAudioDeviceTest::OnGetHardwareInputSampleRate(int* sample_rate) { 221 void WebRTCAudioDeviceTest::OnGetHardwareInputSampleRate(int* sample_rate) {
222 EXPECT_TRUE(audio_util_callback_); 222 EXPECT_TRUE(audio_util_callback_);
223 *sample_rate = audio_util_callback_ ? 223 *sample_rate = audio_util_callback_ ?
224 audio_util_callback_->GetAudioInputHardwareSampleRate( 224 audio_util_callback_->GetAudioInputHardwareSampleRate(
225 AudioManagerBase::kDefaultDeviceId) : 0; 225 media::AudioManagerBase::kDefaultDeviceId) : 0;
226 } 226 }
227 227
228 void WebRTCAudioDeviceTest::OnGetHardwareInputChannelLayout( 228 void WebRTCAudioDeviceTest::OnGetHardwareInputChannelLayout(
229 ChannelLayout* layout) { 229 ChannelLayout* layout) {
230 EXPECT_TRUE(audio_util_callback_); 230 EXPECT_TRUE(audio_util_callback_);
231 *layout = audio_util_callback_ ? 231 *layout = audio_util_callback_ ?
232 audio_util_callback_->GetAudioInputHardwareChannelLayout( 232 audio_util_callback_->GetAudioInputHardwareChannelLayout(
233 AudioManagerBase::kDefaultDeviceId) : CHANNEL_LAYOUT_NONE; 233 media::AudioManagerBase::kDefaultDeviceId) : CHANNEL_LAYOUT_NONE;
234 } 234 }
235 235
236 // IPC::Channel::Listener implementation. 236 // IPC::Channel::Listener implementation.
237 bool WebRTCAudioDeviceTest::OnMessageReceived(const IPC::Message& message) { 237 bool WebRTCAudioDeviceTest::OnMessageReceived(const IPC::Message& message) {
238 if (render_thread_) { 238 if (render_thread_) {
239 IPC::ChannelProxy::MessageFilter* filter = 239 IPC::ChannelProxy::MessageFilter* filter =
240 render_thread_->audio_input_message_filter(); 240 render_thread_->audio_input_message_filter();
241 if (filter->OnMessageReceived(message)) 241 if (filter->OnMessageReceived(message))
242 return true; 242 return true;
243 243
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 WebRTCTransportImpl::~WebRTCTransportImpl() {} 321 WebRTCTransportImpl::~WebRTCTransportImpl() {}
322 322
323 int WebRTCTransportImpl::SendPacket(int channel, const void* data, int len) { 323 int WebRTCTransportImpl::SendPacket(int channel, const void* data, int len) {
324 return network_->ReceivedRTPPacket(channel, data, len); 324 return network_->ReceivedRTPPacket(channel, data, len);
325 } 325 }
326 326
327 int WebRTCTransportImpl::SendRTCPPacket(int channel, const void* data, 327 int WebRTCTransportImpl::SendRTCPPacket(int channel, const void* data,
328 int len) { 328 int len) {
329 return network_->ReceivedRTCPPacket(channel, data, len); 329 return network_->ReceivedRTCPPacket(channel, data, len);
330 } 330 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698