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

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: Created 8 years, 8 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
« no previous file with comments | « content/test/webrtc_audio_device_test.h ('k') | media/audio/android/audio_manager_android.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 173
174 // Create an IPC channel that handles incoming messages on the IO thread. 174 // Create an IPC channel that handles incoming messages on the IO thread.
175 CreateChannel(thread_name); 175 CreateChannel(thread_name);
176 } 176 }
177 177
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 void WebRTCAudioDeviceTest::OnGetHardwareSampleRate(int* sample_rate) { 214 void WebRTCAudioDeviceTest::OnGetHardwareSampleRate(int* sample_rate) {
215 EXPECT_TRUE(audio_util_callback_); 215 EXPECT_TRUE(audio_util_callback_);
216 *sample_rate = audio_util_callback_ ? 216 *sample_rate = audio_util_callback_ ?
217 audio_util_callback_->GetAudioHardwareSampleRate() : 0; 217 audio_util_callback_->GetAudioHardwareSampleRate() : 0;
218 } 218 }
219 219
220 void WebRTCAudioDeviceTest::OnGetHardwareInputSampleRate(int* sample_rate) { 220 void WebRTCAudioDeviceTest::OnGetHardwareInputSampleRate(int* sample_rate) {
221 EXPECT_TRUE(audio_util_callback_); 221 EXPECT_TRUE(audio_util_callback_);
222 *sample_rate = audio_util_callback_ ? 222 *sample_rate = audio_util_callback_ ?
223 audio_util_callback_->GetAudioInputHardwareSampleRate( 223 audio_util_callback_->GetAudioInputHardwareSampleRate(
224 AudioManagerBase::kDefaultDeviceId) : 0; 224 media::AudioManagerBase::kDefaultDeviceId) : 0;
225 } 225 }
226 226
227 void WebRTCAudioDeviceTest::OnGetHardwareInputChannelLayout( 227 void WebRTCAudioDeviceTest::OnGetHardwareInputChannelLayout(
228 ChannelLayout* layout) { 228 ChannelLayout* layout) {
229 EXPECT_TRUE(audio_util_callback_); 229 EXPECT_TRUE(audio_util_callback_);
230 *layout = audio_util_callback_ ? 230 *layout = audio_util_callback_ ?
231 audio_util_callback_->GetAudioInputHardwareChannelLayout( 231 audio_util_callback_->GetAudioInputHardwareChannelLayout(
232 AudioManagerBase::kDefaultDeviceId) : CHANNEL_LAYOUT_NONE; 232 media::AudioManagerBase::kDefaultDeviceId) : CHANNEL_LAYOUT_NONE;
233 } 233 }
234 234
235 // IPC::Channel::Listener implementation. 235 // IPC::Channel::Listener implementation.
236 bool WebRTCAudioDeviceTest::OnMessageReceived(const IPC::Message& message) { 236 bool WebRTCAudioDeviceTest::OnMessageReceived(const IPC::Message& message) {
237 if (render_thread_) { 237 if (render_thread_) {
238 IPC::ChannelProxy::MessageFilter* filter = 238 IPC::ChannelProxy::MessageFilter* filter =
239 render_thread_->audio_input_message_filter(); 239 render_thread_->audio_input_message_filter();
240 if (filter->OnMessageReceived(message)) 240 if (filter->OnMessageReceived(message))
241 return true; 241 return true;
242 242
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 WebRTCTransportImpl::~WebRTCTransportImpl() {} 320 WebRTCTransportImpl::~WebRTCTransportImpl() {}
321 321
322 int WebRTCTransportImpl::SendPacket(int channel, const void* data, int len) { 322 int WebRTCTransportImpl::SendPacket(int channel, const void* data, int len) {
323 return network_->ReceivedRTPPacket(channel, data, len); 323 return network_->ReceivedRTPPacket(channel, data, len);
324 } 324 }
325 325
326 int WebRTCTransportImpl::SendRTCPPacket(int channel, const void* data, 326 int WebRTCTransportImpl::SendRTCPPacket(int channel, const void* data,
327 int len) { 327 int len) {
328 return network_->ReceivedRTCPPacket(channel, data, len); 328 return network_->ReceivedRTCPPacket(channel, data, len);
329 } 329 }
OLDNEW
« no previous file with comments | « content/test/webrtc_audio_device_test.h ('k') | media/audio/android/audio_manager_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698