| Index: media/audio/sounds/sounds_manager_unittest.cc
|
| diff --git a/media/audio/sounds/sounds_manager_unittest.cc b/media/audio/sounds/sounds_manager_unittest.cc
|
| index 6dfcf11939efa994248229f56e5c75048a7d684e..522cf0dc259602e6566591d9eff367cbb333a342 100644
|
| --- a/media/audio/sounds/sounds_manager_unittest.cc
|
| +++ b/media/audio/sounds/sounds_manager_unittest.cc
|
| @@ -26,12 +26,18 @@ class SoundsManagerTest : public testing::Test {
|
| ~SoundsManagerTest() override {}
|
|
|
| void SetUp() override {
|
| - audio_manager_.reset(AudioManager::CreateForTesting());
|
| + audio_manager_ =
|
| + AudioManager::CreateForTesting(message_loop_.task_runner());
|
| SoundsManager::Create();
|
| }
|
|
|
| void TearDown() override {
|
| SoundsManager::Shutdown();
|
| + // AudioStreamHandler destructor posts stop and delete task to audio thread.
|
| + // Flush audio thread to ensure that those tasks are run before attempting
|
| + // to destroy AudioManager.
|
| + base::RunLoop().RunUntilIdle();
|
| +
|
| audio_manager_.reset();
|
| }
|
|
|
| @@ -45,7 +51,7 @@ class SoundsManagerTest : public testing::Test {
|
| }
|
|
|
| private:
|
| - scoped_ptr<AudioManager> audio_manager_;
|
| + ScopedAudioManagerPtr audio_manager_;
|
|
|
| base::MessageLoop message_loop_;
|
| };
|
|
|