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

Unified Diff: media/audio/audio_input_controller_unittest.cc

Issue 2086353002: Remove calls to deprecated MessageLoop methods in media. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | media/audio/audio_output_device_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/audio_input_controller_unittest.cc
diff --git a/media/audio/audio_input_controller_unittest.cc b/media/audio/audio_input_controller_unittest.cc
index 3331c2eb3d61bb124f7fff7ba7affb85ed3608c6..1c0aa96d35d55a432352a09c3ace3043f56cf5c7 100644
--- a/media/audio/audio_input_controller_unittest.cc
+++ b/media/audio/audio_input_controller_unittest.cc
@@ -5,6 +5,7 @@
#include "base/bind.h"
#include "base/macros.h"
#include "base/message_loop/message_loop.h"
+#include "base/run_loop.h"
#include "base/synchronization/waitable_event.h"
#include "base/test/test_timeouts.h"
#include "media/audio/audio_device_description.h"
@@ -42,7 +43,7 @@ ACTION_P3(CheckCountAndPostQuitTask, count, limit, loop_or_proxy) {
// Closes AudioOutputController synchronously.
static void CloseAudioController(AudioInputController* controller) {
controller->Close(base::MessageLoop::QuitWhenIdleClosure());
- base::MessageLoop::current()->Run();
+ base::RunLoop().Run();
}
class MockAudioInputControllerEventHandler
@@ -71,11 +72,11 @@ class AudioInputControllerTest : public testing::Test {
: audio_manager_(
AudioManager::CreateForTesting(message_loop_.task_runner())) {
// Flush the message loop to ensure that AudioManager is fully initialized.
- message_loop_.RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
}
~AudioInputControllerTest() override {
audio_manager_.reset();
- message_loop_.RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
}
protected:
@@ -103,7 +104,7 @@ TEST_F(AudioInputControllerTest, CreateAndClose) {
ASSERT_TRUE(controller.get());
// Wait for OnCreated() to fire.
- message_loop_.Run();
+ base::RunLoop().Run();
// Close the AudioInputController synchronously.
CloseAudioController(controller.get());
@@ -141,7 +142,7 @@ TEST_F(AudioInputControllerTest, RecordAndClose) {
controller->Record();
// Record and wait until ten OnData() callbacks are received.
- message_loop_.Run();
+ base::RunLoop().Run();
// Close the AudioInputController synchronously.
CloseAudioController(controller.get());
@@ -190,12 +191,12 @@ TEST_F(AudioInputControllerTest, DISABLED_RecordAndError) {
controller->Record();
// Record and wait until ten OnData() callbacks are received.
- message_loop_.Run();
+ base::RunLoop().Run();
// Stop the stream and verify that OnError() is posted.
AudioInputStream* stream = controller->stream_for_testing();
stream->Stop();
- message_loop_.Run();
+ base::RunLoop().Run();
// Close the AudioInputController synchronously.
CloseAudioController(controller.get());
@@ -245,10 +246,10 @@ TEST_F(AudioInputControllerTest, CloseTwice) {
controller->Record();
controller->Close(base::MessageLoop::QuitWhenIdleClosure());
- base::MessageLoop::current()->Run();
+ base::RunLoop().Run();
controller->Close(base::MessageLoop::QuitWhenIdleClosure());
- base::MessageLoop::current()->Run();
+ base::RunLoop().Run();
}
} // namespace media
« no previous file with comments | « no previous file | media/audio/audio_output_device_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698