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

Unified Diff: content/browser/renderer_host/media/audio_input_device_manager_unittest.cc

Issue 10662049: Move the device enumerate/open/close work to device thread from IO thread (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: small changes to fix the trybots' failure Created 8 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/media/audio_input_device_manager_unittest.cc
diff --git a/content/browser/renderer_host/media/audio_input_device_manager_unittest.cc b/content/browser/renderer_host/media/audio_input_device_manager_unittest.cc
index fe57150d6747de15616b50c29d8ad9b4a1fd0b82..257cec70777df390c88599b02e6ba7fc37b4ff66 100644
--- a/content/browser/renderer_host/media/audio_input_device_manager_unittest.cc
+++ b/content/browser/renderer_host/media/audio_input_device_manager_unittest.cc
@@ -87,12 +87,7 @@ ACTION_P(ExitMessageLoop, message_loop) {
class AudioInputDeviceManagerTest : public testing::Test {
public:
- AudioInputDeviceManagerTest()
- : message_loop_(),
- io_thread_(),
- manager_(),
- audio_input_listener_() {
- }
+ AudioInputDeviceManagerTest() {}
// Returns true iff machine has an audio input device.
bool CanRunAudioInputDeviceTests() {
@@ -100,27 +95,28 @@ class AudioInputDeviceManagerTest : public testing::Test {
}
protected:
- virtual void SetUp() {
+ virtual void SetUp() OVERRIDE {
// The test must run on Browser::IO.
message_loop_.reset(new MessageLoop(MessageLoop::TYPE_IO));
io_thread_.reset(new BrowserThreadImpl(BrowserThread::IO,
message_loop_.get()));
- audio_manager_.reset(media::AudioManager::Create());
+ audio_manager_.reset(media::AudioManager::Create());
manager_ = new AudioInputDeviceManager(audio_manager_.get());
audio_input_listener_.reset(new MockAudioInputDeviceManagerListener());
- manager_->Register(audio_input_listener_.get());
+ manager_->Register(audio_input_listener_.get(),
+ message_loop_->message_loop_proxy());
// Gets the enumerated device list from the AudioInputDeviceManager.
manager_->EnumerateDevices();
EXPECT_CALL(*audio_input_listener_, DevicesEnumerated(_))
.Times(1);
- // Waits for the callback.
+ // Wait until we get the list.
message_loop_->RunAllPending();
}
- virtual void TearDown() {
+ virtual void TearDown() OVERRIDE {
manager_->Unregister();
io_thread_.reset();
}

Powered by Google App Engine
This is Rietveld 408576698