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

Unified Diff: media/audio/audio_input_controller_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: media/audio/audio_input_controller_unittest.cc
diff --git a/media/audio/audio_input_controller_unittest.cc b/media/audio/audio_input_controller_unittest.cc
index 545cd1d615fcb5304122beefdfd5308a427f0f9e..b3168fee829f04cb652ba2c0fd4dd55feb81fe78 100644
--- a/media/audio/audio_input_controller_unittest.cc
+++ b/media/audio/audio_input_controller_unittest.cc
@@ -89,8 +89,8 @@ class AudioInputControllerTest : public testing::Test {
}
~AudioInputControllerTest() override {
audio_task_runner()->PostTask(
- FROM_HERE, base::Bind(&AudioInputControllerTest::DeleteAudioManager,
- base::Unretained(this)));
+ FROM_HERE, base::Bind(&AudioManager::Shutdown,
+ base::Unretained(audio_manager_.get())));
audio_thread_.Stop();
}
@@ -107,13 +107,12 @@ class AudioInputControllerTest : public testing::Test {
void ResumeAudioThread() { suspend_event_.Signal(); }
private:
- void DeleteAudioManager() { audio_manager_.reset(); }
void WaitForResume() { suspend_event_.Wait(); }
protected:
base::Thread audio_thread_;
base::MessageLoop message_loop_;
- ScopedAudioManagerPtr audio_manager_;
+ std::unique_ptr<AudioManager> audio_manager_;
WaitableEvent suspend_event_;
private:

Powered by Google App Engine
This is Rietveld 408576698