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

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

Issue 10449094: Fix client-side phishing detection test flakiness and ChromeOS failure. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Generalize the fix and apply it to webrtc_audio_device_test Created 8 years, 6 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"
11 #include "base/message_loop.h" 11 #include "base/message_loop.h"
12 #include "base/synchronization/waitable_event.h" 12 #include "base/synchronization/waitable_event.h"
13 #include "base/test/test_timeouts.h" 13 #include "base/test/test_timeouts.h"
14 #include "base/win/scoped_com_initializer.h" 14 #include "base/win/scoped_com_initializer.h"
15 #include "content/browser/renderer_host/media/audio_input_renderer_host.h" 15 #include "content/browser/renderer_host/media/audio_input_renderer_host.h"
16 #include "content/browser/renderer_host/media/audio_renderer_host.h" 16 #include "content/browser/renderer_host/media/audio_renderer_host.h"
17 #include "content/browser/renderer_host/media/media_stream_manager.h" 17 #include "content/browser/renderer_host/media/media_stream_manager.h"
18 #include "content/browser/renderer_host/media/mock_media_observer.h" 18 #include "content/browser/renderer_host/media/mock_media_observer.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"
22 #include "content/renderer/media/audio_hardware.h" 22 #include "content/renderer/media/audio_hardware.h"
23 #include "content/renderer/media/webrtc_audio_device_impl.h" 23 #include "content/renderer/media/webrtc_audio_device_impl.h"
24 #include "content/renderer/render_process.h" 24 #include "content/renderer/render_process.h"
25 #include "content/renderer/render_thread_impl.h"
26 #include "content/test/mock_resource_context.h" 25 #include "content/test/mock_resource_context.h"
26 #include "content/test/render_test_utils.h"
27 #include "content/test/test_browser_thread.h" 27 #include "content/test/test_browser_thread.h"
28 #include "net/url_request/url_request_test_util.h" 28 #include "net/url_request/url_request_test_util.h"
29 #include "testing/gmock/include/gmock/gmock.h" 29 #include "testing/gmock/include/gmock/gmock.h"
30 #include "testing/gtest/include/gtest/gtest.h" 30 #include "testing/gtest/include/gtest/gtest.h"
31 #include "third_party/webrtc/voice_engine/main/interface/voe_audio_processing.h" 31 #include "third_party/webrtc/voice_engine/main/interface/voe_audio_processing.h"
32 #include "third_party/webrtc/voice_engine/main/interface/voe_base.h" 32 #include "third_party/webrtc/voice_engine/main/interface/voe_base.h"
33 #include "third_party/webrtc/voice_engine/main/interface/voe_file.h" 33 #include "third_party/webrtc/voice_engine/main/interface/voe_file.h"
34 #include "third_party/webrtc/voice_engine/main/interface/voe_network.h" 34 #include "third_party/webrtc/voice_engine/main/interface/voe_network.h"
35 35
36 using base::win::ScopedCOMInitializer; 36 using base::win::ScopedCOMInitializer;
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 130
131 // Construct the resource context on the UI thread. 131 // Construct the resource context on the UI thread.
132 resource_context_.reset(new MockResourceContext); 132 resource_context_.reset(new MockResourceContext);
133 133
134 static const char kThreadName[] = "RenderThread"; 134 static const char kThreadName[] = "RenderThread";
135 ChildProcess::current()->io_message_loop()->PostTask(FROM_HERE, 135 ChildProcess::current()->io_message_loop()->PostTask(FROM_HERE,
136 base::Bind(&WebRTCAudioDeviceTest::InitializeIOThread, 136 base::Bind(&WebRTCAudioDeviceTest::InitializeIOThread,
137 base::Unretained(this), kThreadName)); 137 base::Unretained(this), kThreadName));
138 WaitForIOThreadCompletion(); 138 WaitForIOThreadCompletion();
139 139
140 render_thread_ = new RenderThreadImpl(kThreadName); 140 render_thread_ = new content::RenderThreadImplNoSandbox(kThreadName);
141 } 141 }
142 142
143 void WebRTCAudioDeviceTest::TearDown() { 143 void WebRTCAudioDeviceTest::TearDown() {
144 SetAudioUtilCallback(NULL); 144 SetAudioUtilCallback(NULL);
145 145
146 // Run any pending cleanup tasks that may have been posted to the main thread. 146 // Run any pending cleanup tasks that may have been posted to the main thread.
147 ChildProcess::current()->main_thread()->message_loop()->RunAllPending(); 147 ChildProcess::current()->main_thread()->message_loop()->RunAllPending();
148 148
149 // Kick of the cleanup process by closing the channel. This queues up 149 // Kick of the cleanup process by closing the channel. This queues up
150 // OnStreamClosed calls to be executed on the audio thread. 150 // OnStreamClosed calls to be executed on the audio thread.
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 WebRTCTransportImpl::~WebRTCTransportImpl() {} 349 WebRTCTransportImpl::~WebRTCTransportImpl() {}
350 350
351 int WebRTCTransportImpl::SendPacket(int channel, const void* data, int len) { 351 int WebRTCTransportImpl::SendPacket(int channel, const void* data, int len) {
352 return network_->ReceivedRTPPacket(channel, data, len); 352 return network_->ReceivedRTPPacket(channel, data, len);
353 } 353 }
354 354
355 int WebRTCTransportImpl::SendRTCPPacket(int channel, const void* data, 355 int WebRTCTransportImpl::SendRTCPPacket(int channel, const void* data,
356 int len) { 356 int len) {
357 return network_->ReceivedRTCPPacket(channel, data, len); 357 return network_->ReceivedRTCPPacket(channel, data, len);
358 } 358 }
OLDNEW
« content/test/render_test_utils.h ('K') | « content/test/render_view_test.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698