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

Unified Diff: content/browser/renderer_host/media/audio_output_authorization_handler_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_authorization_handler_unittest.cc
diff --git a/content/browser/renderer_host/media/audio_output_authorization_handler_unittest.cc b/content/browser/renderer_host/media/audio_output_authorization_handler_unittest.cc
index c6631d2cd5595493b79b09727cb1344d294d5058..a15752aeb59dadb91059d713ca7df0291675df44 100644
--- a/content/browser/renderer_host/media/audio_output_authorization_handler_unittest.cc
+++ b/content/browser/renderer_host/media/audio_output_authorization_handler_unittest.cc
@@ -74,7 +74,12 @@ class AudioOutputAuthorizationHandlerTest : public testing::Test {
SyncWithAllThreads();
}
- ~AudioOutputAuthorizationHandlerTest() override { SyncWithAllThreads(); }
+ ~AudioOutputAuthorizationHandlerTest() override {
+ audio_manager_->GetTaskRunner()->PostTask(
+ FROM_HERE, base::Bind(&media::AudioManager::Shutdown,
+ base::Unretained(audio_manager_.get())));
+ SyncWithAllThreads();
+ }
protected:
MediaStreamManager* GetMediaStreamManager() {
@@ -139,10 +144,10 @@ class AudioOutputAuthorizationHandlerTest : public testing::Test {
// DestructionObserver.
std::unique_ptr<MediaStreamManager> media_stream_manager_;
std::unique_ptr<TestBrowserThreadBundle> thread_bundle_;
- std::unique_ptr<AudioManagerThread> audio_thread_;
media::FakeAudioLogFactory log_factory_;
- media::ScopedAudioManagerPtr audio_manager_;
+ std::unique_ptr<media::AudioManager> audio_manager_;
std::unique_ptr<media::AudioSystem> audio_system_;
+ std::unique_ptr<AudioManagerThread> audio_thread_;
DISALLOW_COPY_AND_ASSIGN(AudioOutputAuthorizationHandlerTest);
};

Powered by Google App Engine
This is Rietveld 408576698