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

Unified Diff: content/browser/renderer_host/media/audio_output_delegate_impl_unittest.cc

Issue 2784433002: Ensures that audio tasks cannot run after AudioManager is deleted. (Closed)
Patch Set: fixes content_browsertests and content_unittests Created 3 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: content/browser/renderer_host/media/audio_output_delegate_impl_unittest.cc
diff --git a/content/browser/renderer_host/media/audio_output_delegate_impl_unittest.cc b/content/browser/renderer_host/media/audio_output_delegate_impl_unittest.cc
index 2d64eff6d9dddb2b76d9f34c0bb0990ac327264f..b3091e981637e0985546e7495ae7c400b8245378 100644
--- a/content/browser/renderer_host/media/audio_output_delegate_impl_unittest.cc
+++ b/content/browser/renderer_host/media/audio_output_delegate_impl_unittest.cc
@@ -120,6 +120,11 @@ class AudioOutputDelegateTest : public testing::Test {
media_stream_manager_ =
base::MakeUnique<MediaStreamManager>(audio_system_.get());
}
+ ~AudioOutputDelegateTest() {
+ audio_manager_->GetTaskRunner()->PostTask(
+ FROM_HERE, base::Bind(&media::AudioManager::Shutdown,
+ base::Unretained(audio_manager_.get())));
+ }
// Test bodies are here, so that we can run them on the IO thread.
void CreateTest(base::Closure done) {
@@ -450,8 +455,8 @@ class AudioOutputDelegateTest : public testing::Test {
// TestBrowserThreadBundle.
std::unique_ptr<MediaStreamManager> media_stream_manager_;
std::unique_ptr<TestBrowserThreadBundle> thread_bundle_;
+ std::unique_ptr<media::AudioManager> audio_manager_;
std::unique_ptr<AudioManagerThread> audio_thread_;
- media::ScopedAudioManagerPtr audio_manager_;
std::unique_ptr<media::AudioSystem> audio_system_;
StrictMock<MockAudioMirroringManager> mirroring_manager_;
StrictMock<MockEventHandler> event_handler_;

Powered by Google App Engine
This is Rietveld 408576698