OLD | NEW |
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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 // Construct the resource context on the UI thread. | 115 // Construct the resource context on the UI thread. |
116 resource_context_.reset(new WebRTCMockResourceContext()); | 116 resource_context_.reset(new WebRTCMockResourceContext()); |
117 | 117 |
118 static const char kThreadName[] = "RenderThread"; | 118 static const char kThreadName[] = "RenderThread"; |
119 ChildProcess::current()->io_message_loop()->PostTask(FROM_HERE, | 119 ChildProcess::current()->io_message_loop()->PostTask(FROM_HERE, |
120 base::Bind(&WebRTCAudioDeviceTest::InitializeIOThread, | 120 base::Bind(&WebRTCAudioDeviceTest::InitializeIOThread, |
121 base::Unretained(this), kThreadName)); | 121 base::Unretained(this), kThreadName)); |
122 WaitForIOThreadCompletion(); | 122 WaitForIOThreadCompletion(); |
123 | 123 |
124 render_thread_ = new RenderThreadImpl(kThreadName); | 124 render_thread_ = new RenderThreadImpl(kThreadName); |
125 mock_process_->set_main_thread(render_thread_); | |
126 } | 125 } |
127 | 126 |
128 void WebRTCAudioDeviceTest::TearDown() { | 127 void WebRTCAudioDeviceTest::TearDown() { |
129 SetAudioUtilCallback(NULL); | 128 SetAudioUtilCallback(NULL); |
130 | 129 |
131 // Kick of the cleanup process by closing the channel. This queues up | 130 // Kick of the cleanup process by closing the channel. This queues up |
132 // OnStreamClosed calls to be executed on the audio thread. | 131 // OnStreamClosed calls to be executed on the audio thread. |
133 ChildProcess::current()->io_message_loop()->PostTask(FROM_HERE, | 132 ChildProcess::current()->io_message_loop()->PostTask(FROM_HERE, |
134 base::Bind(&WebRTCAudioDeviceTest::DestroyChannel, | 133 base::Bind(&WebRTCAudioDeviceTest::DestroyChannel, |
135 base::Unretained(this))); | 134 base::Unretained(this))); |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 WebRTCTransportImpl::~WebRTCTransportImpl() {} | 328 WebRTCTransportImpl::~WebRTCTransportImpl() {} |
330 | 329 |
331 int WebRTCTransportImpl::SendPacket(int channel, const void* data, int len) { | 330 int WebRTCTransportImpl::SendPacket(int channel, const void* data, int len) { |
332 return network_->ReceivedRTPPacket(channel, data, len); | 331 return network_->ReceivedRTPPacket(channel, data, len); |
333 } | 332 } |
334 | 333 |
335 int WebRTCTransportImpl::SendRTCPPacket(int channel, const void* data, | 334 int WebRTCTransportImpl::SendRTCPPacket(int channel, const void* data, |
336 int len) { | 335 int len) { |
337 return network_->ReceivedRTCPPacket(channel, data, len); | 336 return network_->ReceivedRTCPPacket(channel, data, len); |
338 } | 337 } |
OLD | NEW |