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

Unified Diff: media/audio/mock_audio_manager.h

Issue 1806313003: Pass task runners to AudioManager constructor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments from patch 48 Created 4 years, 8 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
« no previous file with comments | « media/audio/mac/audio_manager_mac.cc ('k') | media/audio/mock_audio_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/mock_audio_manager.h
diff --git a/media/audio/mock_audio_manager.h b/media/audio/mock_audio_manager.h
index 60a8b1ea99e67b147e8d5f5fd2c83c0bfc1d474d..33f7e5eace700d5d99c849bb6b6f033493cdefc9 100644
--- a/media/audio/mock_audio_manager.h
+++ b/media/audio/mock_audio_manager.h
@@ -11,19 +11,13 @@
namespace media {
// This class is a simple mock around AudioManager, used exclusively for tests,
-// which has the following purposes:
-// 1) Avoids to use the actual (system and platform dependent) AudioManager.
-// Some bots does not have input devices, thus using the actual AudioManager
-// would causing failures on classes which expect that.
-// 2) Allows the mock audio events to be dispatched on an arbitrary thread,
-// rather than forcing them on the audio thread, easing their handling in
-// browser tests (Note: sharing a thread can cause deadlocks on production
-// classes if WaitableEvents or any other form of lock is used for
-// synchronization purposes).
+// which avoids to use the actual (system and platform dependent) AudioManager.
+// Some bots does not have input devices, thus using the actual AudioManager
+// would causing failures on classes which expect that.
class MockAudioManager : public media::AudioManager {
public:
explicit MockAudioManager(
- const scoped_refptr<base::SingleThreadTaskRunner>& task_runner);
+ scoped_refptr<base::SingleThreadTaskRunner> task_runner);
bool HasAudioOutputDevices() override;
@@ -50,9 +44,6 @@ class MockAudioManager : public media::AudioManager {
const media::AudioParameters& params,
const std::string& device_id) override;
- scoped_refptr<base::SingleThreadTaskRunner> GetTaskRunner() override;
- scoped_refptr<base::SingleThreadTaskRunner> GetWorkerTaskRunner() override;
-
void AddOutputDeviceChangeListener(AudioDeviceListener* listener) override;
void RemoveOutputDeviceChangeListener(AudioDeviceListener* listener) override;
@@ -71,8 +62,6 @@ class MockAudioManager : public media::AudioManager {
~MockAudioManager() override;
private:
- scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
-
DISALLOW_COPY_AND_ASSIGN(MockAudioManager);
};
« no previous file with comments | « media/audio/mac/audio_manager_mac.cc ('k') | media/audio/mock_audio_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698