| Index: media/audio/mac/audio_device_listener_mac_unittest.cc
|
| diff --git a/media/audio/mac/audio_device_listener_mac_unittest.cc b/media/audio/mac/audio_device_listener_mac_unittest.cc
|
| index 06894c819e9318a936ded1b5a10e1b8e4966cfa9..3b8384f608fff29ade7109f5153664c7cbcb9570 100644
|
| --- a/media/audio/mac/audio_device_listener_mac_unittest.cc
|
| +++ b/media/audio/mac/audio_device_listener_mac_unittest.cc
|
| @@ -12,6 +12,8 @@
|
| #include "base/bind_helpers.h"
|
| #include "base/macros.h"
|
| #include "base/message_loop/message_loop.h"
|
| +#include "base/run_loop.h"
|
| +#include "base/single_thread_task_runner.h"
|
| #include "media/base/bind_to_current_loop.h"
|
| #include "testing/gmock/include/gmock/gmock.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
| @@ -23,19 +25,20 @@ class AudioDeviceListenerMacTest : public testing::Test {
|
| AudioDeviceListenerMacTest() {
|
| // It's important to create the device listener from the message loop in
|
| // order to ensure we don't end up with unbalanced TaskObserver calls.
|
| - message_loop_.PostTask(FROM_HERE, base::Bind(
|
| - &AudioDeviceListenerMacTest::CreateDeviceListener,
|
| - base::Unretained(this)));
|
| - message_loop_.RunUntilIdle();
|
| + message_loop_.task_runner()->PostTask(
|
| + FROM_HERE, base::Bind(&AudioDeviceListenerMacTest::CreateDeviceListener,
|
| + base::Unretained(this)));
|
| + base::RunLoop().RunUntilIdle();
|
| }
|
|
|
| virtual ~AudioDeviceListenerMacTest() {
|
| // It's important to destroy the device listener from the message loop in
|
| // order to ensure we don't end up with unbalanced TaskObserver calls.
|
| - message_loop_.PostTask(FROM_HERE, base::Bind(
|
| - &AudioDeviceListenerMacTest::DestroyDeviceListener,
|
| - base::Unretained(this)));
|
| - message_loop_.RunUntilIdle();
|
| + message_loop_.task_runner()->PostTask(
|
| + FROM_HERE,
|
| + base::Bind(&AudioDeviceListenerMacTest::DestroyDeviceListener,
|
| + base::Unretained(this)));
|
| + base::RunLoop().RunUntilIdle();
|
| }
|
|
|
| void CreateDeviceListener() {
|
| @@ -83,7 +86,7 @@ TEST_F(AudioDeviceListenerMacTest, OutputDeviceChange) {
|
| ASSERT_TRUE(ListenerIsValid());
|
| EXPECT_CALL(*this, OnDeviceChange()).Times(1);
|
| ASSERT_TRUE(SimulateDefaultOutputDeviceChange());
|
| - message_loop_.RunUntilIdle();
|
| + base::RunLoop().RunUntilIdle();
|
| }
|
|
|
| } // namespace media
|
|
|