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

Unified Diff: media/audio/audio_manager.cc

Issue 10704154: Small refactor to media architecture in order to allow end-to-end tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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_manager.cc
diff --git a/media/audio/audio_manager.cc b/media/audio/audio_manager.cc
index 028b409149187c78bf9536df07cf16570b59106a..495673bb352cc8d3e340f9733b44b76a5c0cb7ea 100644
--- a/media/audio/audio_manager.cc
+++ b/media/audio/audio_manager.cc
@@ -10,6 +10,8 @@
namespace media {
+AudioManager* AudioManager::audio_manager_for_tests_ = NULL;
+
// Forward declaration of the platform specific AudioManager factory function.
AudioManager* CreateAudioManager();
@@ -21,9 +23,16 @@ AudioManager::~AudioManager() {
// static
AudioManager* AudioManager::Create() {
+ if (audio_manager_for_tests_)
+ return audio_manager_for_tests_;
AudioManager* ret = CreateAudioManager();
ret->Init();
return ret;
}
+// static
+void AudioManager::set_audio_manager_for_tests(AudioManager* audio_manager) {
+ audio_manager_for_tests_ = audio_manager;
+}
+
} // namespace media

Powered by Google App Engine
This is Rietveld 408576698