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 4dab5f7d3af9934ea67528f0c0657159e8c27118..6b98fb3681ef57356e5b5dd76f3cc75e86143b01 100644 |
--- a/media/audio/audio_input_controller_unittest.cc |
+++ b/media/audio/audio_input_controller_unittest.cc |
@@ -26,9 +26,8 @@ static const int kBitsPerSample = 16; |
static const ChannelLayout kChannelLayout = CHANNEL_LAYOUT_STEREO; |
static const int kSamplesPerPacket = kSampleRate / 10; |
-// Posts base::MessageLoop::QuitWhenIdleClosure() on specified message loop. |
-ACTION_P(QuitMessageLoop, loop_or_proxy) { |
- loop_or_proxy->PostTask(FROM_HERE, base::MessageLoop::QuitWhenIdleClosure()); |
+ACTION_P(QuitRunLoop, run_loop) { |
+ run_loop->QuitWhenIdle(); |
} |
// Posts base::MessageLoop::QuitWhenIdleClosure() on specified message loop |
@@ -89,11 +88,13 @@ class AudioInputControllerTest : public testing::Test { |
// Test AudioInputController for create and close without recording audio. |
TEST_F(AudioInputControllerTest, CreateAndClose) { |
+ base::RunLoop run_loop; |
+ |
MockAudioInputControllerEventHandler event_handler; |
// OnCreated() will be posted once. |
EXPECT_CALL(event_handler, OnCreated(NotNull())) |
- .WillOnce(QuitMessageLoop(&message_loop_)); |
+ .WillOnce(QuitRunLoop(&run_loop)); |
AudioParameters params(AudioParameters::AUDIO_FAKE, kChannelLayout, |
kSampleRate, kBitsPerSample, kSamplesPerPacket); |
@@ -104,7 +105,7 @@ TEST_F(AudioInputControllerTest, CreateAndClose) { |
ASSERT_TRUE(controller.get()); |
// Wait for OnCreated() to fire. |
- base::RunLoop().Run(); |
+ run_loop.Run(); |
// Close the AudioInputController synchronously. |
CloseAudioController(controller.get()); |