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

Unified Diff: chromeos/audio/audio_devices_pref_handler_stub.h

Issue 19861002: Add test coverage for CrasAudioHandler. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nit. Created 7 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
« no previous file with comments | « chromeos/audio/audio_devices_pref_handler.h ('k') | chromeos/audio/audio_devices_pref_handler_stub.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/audio/audio_devices_pref_handler_stub.h
diff --git a/chromeos/audio/audio_devices_pref_handler_stub.h b/chromeos/audio/audio_devices_pref_handler_stub.h
new file mode 100644
index 0000000000000000000000000000000000000000..5f585ed0859e0ba770b3202168c716272ec250f3
--- /dev/null
+++ b/chromeos/audio/audio_devices_pref_handler_stub.h
@@ -0,0 +1,47 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROMEOS_AUDIO_AUDIO_DEVICES_PREF_HANDLER_STUB_H_
+#define CHROMEOS_AUDIO_AUDIO_DEVICES_PREF_HANDLER_STUB_H_
+
+#include "chromeos/audio/audio_devices_pref_handler.h"
+
+#include <map>
+
+namespace chromeos {
+
+struct AudioDevice;
+
+// Stub class for AudioDevicesPrefHandler, used for testing.
+class CHROMEOS_EXPORT AudioDevicesPrefHandlerStub
+ : public AudioDevicesPrefHandler {
+ public:
+ typedef std::map<uint64, bool> AudioDeviceMute;
+ typedef std::map<uint64, int> AudioDeviceVolumeGain;
+
+ AudioDevicesPrefHandlerStub();
+
+ virtual double GetVolumeGainValue(const AudioDevice& device) OVERRIDE;
+ virtual void SetVolumeGainValue(const AudioDevice& device,
+ double value) OVERRIDE;
+ virtual bool GetMuteValue(const AudioDevice& device) OVERRIDE;
+ virtual void SetMuteValue(const AudioDevice& device, bool mute_on) OVERRIDE;
+ virtual bool GetAudioCaptureAllowedValue() OVERRIDE;
+ virtual bool GetAudioOutputAllowedValue() OVERRIDE;
+ virtual void AddAudioPrefObserver(AudioPrefObserver* observer) OVERRIDE;
+ virtual void RemoveAudioPrefObserver(AudioPrefObserver* observer) OVERRIDE;
+
+ protected:
+ virtual ~AudioDevicesPrefHandlerStub();
+
+ private:
+ AudioDeviceMute audio_device_mute_map_;
+ AudioDeviceVolumeGain audio_device_volume_gain_map_;
+
+ DISALLOW_COPY_AND_ASSIGN(AudioDevicesPrefHandlerStub);
+};
+
+} // namespace chromeos
+
+#endif // CHROMEOS_AUDIO_AUDIO_DEVICES_PREF_HANDLER_STUB_H_
« no previous file with comments | « chromeos/audio/audio_devices_pref_handler.h ('k') | chromeos/audio/audio_devices_pref_handler_stub.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698