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

Unified Diff: chromeos/dbus/fake_cras_audio_client.h

Issue 2087803003: Sync volume state using cras signal OutputNodeVolumeChanged. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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/cras_audio_handler_unittest.cc ('k') | chromeos/dbus/fake_cras_audio_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/dbus/fake_cras_audio_client.h
diff --git a/chromeos/dbus/fake_cras_audio_client.h b/chromeos/dbus/fake_cras_audio_client.h
index 84ae84f081316880f753c98802602b84d8c21b91..443085363c43cd1947e8608db35b17b3bae9a460 100644
--- a/chromeos/dbus/fake_cras_audio_client.h
+++ b/chromeos/dbus/fake_cras_audio_client.h
@@ -60,20 +60,29 @@ class CHROMEOS_EXPORT FakeCrasAudioClient : public CrasAudioClient {
void SetAudioNodesAndNotifyObserversForTesting(
const AudioNodeList& new_nodes);
+ // Generates fake signal for OutputNodeVolumeChanged.
+ void NotifyOutputNodeVolumeChangedForTesting(uint64_t node_id, int volume);
+
const AudioNodeList& node_list() const { return node_list_; }
const uint64_t& active_input_node_id() const { return active_input_node_id_; }
const uint64_t& active_output_node_id() const {
return active_output_node_id_;
}
+ void set_notify_volume_change_with_delay(bool notify_with_delay) {
+ notify_volume_change_with_delay_ = notify_with_delay;
+ }
private:
- // Find a node in the list based on the id.
+ // Finds a node in the list based on the id.
AudioNodeList::iterator FindNode(uint64_t node_id);
VolumeState volume_state_;
AudioNodeList node_list_;
uint64_t active_input_node_id_;
uint64_t active_output_node_id_;
+ // By default, immediately sends OutputNodeVolumeChange signal following the
+ // SetOutputNodeVolume fake dbus call.
+ bool notify_volume_change_with_delay_ = false;
base::ObserverList<Observer> observers_;
DISALLOW_COPY_AND_ASSIGN(FakeCrasAudioClient);
« no previous file with comments | « chromeos/audio/cras_audio_handler_unittest.cc ('k') | chromeos/dbus/fake_cras_audio_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698