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

Unified Diff: content/test/webrtc_audio_device_test.cc

Issue 8588030: Refactor the Get*Hardware* routines a bit. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/test/webrtc_audio_device_test.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/test/webrtc_audio_device_test.cc
===================================================================
--- content/test/webrtc_audio_device_test.cc (revision 110480)
+++ content/test/webrtc_audio_device_test.cc (working copy)
@@ -19,6 +19,7 @@
#include "content/common/view_messages.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/common/content_paths.h"
+#include "content/renderer/media/audio_hardware.h"
#include "content/renderer/media/webrtc_audio_device_impl.h"
#include "content/renderer/render_process.h"
#include "content/renderer/render_thread_impl.h"
@@ -125,10 +126,13 @@
}
void WebRTCAudioDeviceTest::TearDown() {
+ SetAudioUtilCallback(NULL);
+
ChildProcess::current()->io_message_loop()->PostTask(
FROM_HERE,
base::Bind(&SetupTask::UninitializeIOThread, new SetupTask(this)));
- WaitForIOThreadCompletion();
+ EXPECT_TRUE(event_.TimedWait(
+ base::TimeDelta::FromMilliseconds(TestTimeouts::action_timeout_ms())));
mock_process_.reset();
}
@@ -136,6 +140,13 @@
return channel_->Send(message);
}
+void WebRTCAudioDeviceTest::SetAudioUtilCallback(AudioUtilInterface* callback) {
+ // Invalidate any potentially cached values since the new callback should
+ // be used for those queries.
+ audio_hardware::ResetCache();
+ audio_util_callback_ = callback;
+}
+
void WebRTCAudioDeviceTest::InitializeIOThread(const char* thread_name) {
// We initialize COM (STA) on our IO thread as is done in Chrome.
// See BrowserProcessSubThread::Init.
@@ -160,6 +171,7 @@
media_stream_manager_.reset();
test_request_context_ = NULL;
initialize_com_.reset();
+ event_.Signal();
}
void WebRTCAudioDeviceTest::CreateChannel(
@@ -182,7 +194,9 @@
void WebRTCAudioDeviceTest::DestroyChannel() {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO));
audio_render_host_->OnChannelClosing();
+ audio_render_host_->OnFilterRemoved();
audio_input_renderer_host_->OnChannelClosing();
+ audio_input_renderer_host_->OnFilterRemoved();
channel_.reset();
audio_render_host_ = NULL;
audio_input_renderer_host_ = NULL;
@@ -237,10 +251,6 @@
EXPECT_TRUE(message_is_ok);
- // We leave a DLOG as a hint to the developer in case important IPC messages
- // are being dropped.
- DLOG_IF(WARNING, !handled) << "Unhandled IPC message";
-
return true;
}
« no previous file with comments | « content/test/webrtc_audio_device_test.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698