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

Unified Diff: media/audio/sounds/sounds_manager_unittest.cc

Issue 1806313003: Pass task runners to AudioManager constructor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 9 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: 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_;
};

Powered by Google App Engine
This is Rietveld 408576698