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; |
} |