OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/file_util.h" | 9 #include "base/file_util.h" |
9 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
10 #include "base/synchronization/waitable_event.h" | 11 #include "base/synchronization/waitable_event.h" |
11 #include "base/test/signaling_task.h" | |
12 #include "base/test/test_timeouts.h" | 12 #include "base/test/test_timeouts.h" |
13 #include "base/win/scoped_com_initializer.h" | 13 #include "base/win/scoped_com_initializer.h" |
14 #include "content/browser/renderer_host/media/audio_input_renderer_host.h" | 14 #include "content/browser/renderer_host/media/audio_input_renderer_host.h" |
15 #include "content/browser/renderer_host/media/audio_renderer_host.h" | 15 #include "content/browser/renderer_host/media/audio_renderer_host.h" |
16 #include "content/browser/renderer_host/media/media_stream_manager.h" | 16 #include "content/browser/renderer_host/media/media_stream_manager.h" |
17 #include "content/browser/renderer_host/media/mock_media_observer.h" | 17 #include "content/browser/renderer_host/media/mock_media_observer.h" |
18 #include "content/browser/resource_context.h" | 18 #include "content/browser/resource_context.h" |
19 #include "content/common/view_messages.h" | 19 #include "content/common/view_messages.h" |
20 #include "content/public/browser/browser_thread.h" | 20 #include "content/public/browser/browser_thread.h" |
21 #include "content/public/common/content_paths.h" | 21 #include "content/public/common/content_paths.h" |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 IPC_END_MESSAGE_MAP_EX() | 250 IPC_END_MESSAGE_MAP_EX() |
251 | 251 |
252 EXPECT_TRUE(message_is_ok); | 252 EXPECT_TRUE(message_is_ok); |
253 | 253 |
254 return true; | 254 return true; |
255 } | 255 } |
256 | 256 |
257 // Posts a final task to the IO message loop and waits for completion. | 257 // Posts a final task to the IO message loop and waits for completion. |
258 void WebRTCAudioDeviceTest::WaitForIOThreadCompletion() { | 258 void WebRTCAudioDeviceTest::WaitForIOThreadCompletion() { |
259 ChildProcess::current()->io_message_loop()->PostTask( | 259 ChildProcess::current()->io_message_loop()->PostTask( |
260 FROM_HERE, new base::SignalingTask(&event_)); | 260 FROM_HERE, base::Bind(&base::WaitableEvent::Signal, |
| 261 base::Unretained(&event_))); |
261 EXPECT_TRUE(event_.TimedWait( | 262 EXPECT_TRUE(event_.TimedWait( |
262 base::TimeDelta::FromMilliseconds(TestTimeouts::action_timeout_ms()))); | 263 base::TimeDelta::FromMilliseconds(TestTimeouts::action_timeout_ms()))); |
263 } | 264 } |
264 | 265 |
265 std::string WebRTCAudioDeviceTest::GetTestDataPath( | 266 std::string WebRTCAudioDeviceTest::GetTestDataPath( |
266 const FilePath::StringType& file_name) { | 267 const FilePath::StringType& file_name) { |
267 FilePath path; | 268 FilePath path; |
268 EXPECT_TRUE(PathService::Get(content::DIR_TEST_DATA, &path)); | 269 EXPECT_TRUE(PathService::Get(content::DIR_TEST_DATA, &path)); |
269 path = path.Append(file_name); | 270 path = path.Append(file_name); |
270 EXPECT_TRUE(file_util::PathExists(path)); | 271 EXPECT_TRUE(file_util::PathExists(path)); |
(...skipping 11 matching lines...) Expand all Loading... |
282 WebRTCTransportImpl::~WebRTCTransportImpl() {} | 283 WebRTCTransportImpl::~WebRTCTransportImpl() {} |
283 | 284 |
284 int WebRTCTransportImpl::SendPacket(int channel, const void* data, int len) { | 285 int WebRTCTransportImpl::SendPacket(int channel, const void* data, int len) { |
285 return network_->ReceivedRTPPacket(channel, data, len); | 286 return network_->ReceivedRTPPacket(channel, data, len); |
286 } | 287 } |
287 | 288 |
288 int WebRTCTransportImpl::SendRTCPPacket(int channel, const void* data, | 289 int WebRTCTransportImpl::SendRTCPPacket(int channel, const void* data, |
289 int len) { | 290 int len) { |
290 return network_->ReceivedRTCPPacket(channel, data, len); | 291 return network_->ReceivedRTCPPacket(channel, data, len); |
291 } | 292 } |
OLD | NEW |