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

Unified Diff: content/browser/renderer_host/media/audio_renderer_host_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_renderer_host_unittest.cc
diff --git a/content/browser/renderer_host/media/audio_renderer_host_unittest.cc b/content/browser/renderer_host/media/audio_renderer_host_unittest.cc
index 20ea45557eb243a36ef6ec40955a899fecfa02bd..5b2e73780368550dcfb4cf5661c25a1c4f638574 100644
--- a/content/browser/renderer_host/media/audio_renderer_host_unittest.cc
+++ b/content/browser/renderer_host/media/audio_renderer_host_unittest.cc
@@ -257,11 +257,10 @@ class AudioRendererHostTest : public testing::Test {
// Simulate closing the IPC channel and give the audio thread time to close
// the underlying streams.
host_->OnChannelClosing();
+ audio_manager_->GetTaskRunner()->PostTask(
+ FROM_HERE, base::Bind(&media::AudioManager::Shutdown,
+ base::Unretained(audio_manager_.get())));
SyncWithAudioThread();
- // To correctly clean up the audio manager, we first put it in a
- // ScopedAudioManagerPtr. It will immediately destruct, cleaning up the
- // audio manager correctly.
- media::ScopedAudioManagerPtr(audio_manager_.release());
// Release the reference to the mock object. The object will be destructed
// on message_loop_.

Powered by Google App Engine
This is Rietveld 408576698