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

Unified Diff: media/audio/sounds/audio_stream_handler_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/pulse/pulse_util.cc ('k') | media/audio/sounds/sounds_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/sounds/audio_stream_handler_unittest.cc
diff --git a/media/audio/sounds/audio_stream_handler_unittest.cc b/media/audio/sounds/audio_stream_handler_unittest.cc
index dc192cd4f49506507892e00b45dec52c68b3f438..47e40fefbbac17a4c581b7172fdd245e0919c3d7 100644
--- a/media/audio/sounds/audio_stream_handler_unittest.cc
+++ b/media/audio/sounds/audio_stream_handler_unittest.cc
@@ -19,6 +19,7 @@
#include "media/audio/audio_manager.h"
#include "media/audio/simple_sources.h"
#include "media/audio/sounds/test_data.h"
+#include "media/audio/test_audio_thread.h"
#include "media/base/channel_layout.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -31,7 +32,7 @@ class AudioStreamHandlerTest : public testing::Test {
void SetUp() override {
audio_manager_ =
- AudioManager::CreateForTesting(base::ThreadTaskRunnerHandle::Get());
+ AudioManager::CreateForTesting(base::MakeUnique<TestAudioThread>());
base::RunLoop().RunUntilIdle();
base::StringPiece data(kTestAudioData, arraysize(kTestAudioData));
@@ -40,6 +41,7 @@ class AudioStreamHandlerTest : public testing::Test {
void TearDown() override {
audio_stream_handler_.reset();
+ audio_manager_->Shutdown();
base::RunLoop().RunUntilIdle();
}
@@ -58,7 +60,7 @@ class AudioStreamHandlerTest : public testing::Test {
private:
base::TestMessageLoop message_loop_;
- ScopedAudioManagerPtr audio_manager_;
+ std::unique_ptr<AudioManager> audio_manager_;
std::unique_ptr<AudioStreamHandler> audio_stream_handler_;
};
« no previous file with comments | « media/audio/pulse/pulse_util.cc ('k') | media/audio/sounds/sounds_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698