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

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

Issue 2784433002: Ensures that audio tasks cannot run after AudioManager is deleted. (Closed)
Patch Set: rebase Created 3 years, 7 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 | « media/audio/sounds/audio_stream_handler_unittest.cc ('k') | media/audio/test_audio_thread.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 ac0234f44218dcccbb3567944c79da9bf1ff93f8..f4b4a3691b320bc8d3f343f2c1b7aa64fca82967 100644
--- a/media/audio/sounds/sounds_manager_unittest.cc
+++ b/media/audio/sounds/sounds_manager_unittest.cc
@@ -16,6 +16,7 @@
#include "media/audio/sounds/audio_stream_handler.h"
#include "media/audio/sounds/sounds_manager.h"
#include "media/audio/sounds/test_data.h"
+#include "media/audio/test_audio_thread.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace media {
@@ -27,13 +28,14 @@ class SoundsManagerTest : public testing::Test {
void SetUp() override {
audio_manager_ =
- AudioManager::CreateForTesting(base::ThreadTaskRunnerHandle::Get());
+ AudioManager::CreateForTesting(base::MakeUnique<TestAudioThread>());
SoundsManager::Create();
base::RunLoop().RunUntilIdle();
}
void TearDown() override {
SoundsManager::Shutdown();
+ audio_manager_->Shutdown();
base::RunLoop().RunUntilIdle();
}
@@ -48,7 +50,7 @@ class SoundsManagerTest : public testing::Test {
private:
base::TestMessageLoop message_loop_;
- ScopedAudioManagerPtr audio_manager_;
+ std::unique_ptr<AudioManager> audio_manager_;
};
TEST_F(SoundsManagerTest, Play) {
« no previous file with comments | « media/audio/sounds/audio_stream_handler_unittest.cc ('k') | media/audio/test_audio_thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698