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

Unified Diff: chromeos/audio/cras_audio_handler_unittest.cc

Issue 2190773002: Fix Volume slider is captured in screenshot done in touchview mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: based on Daniel's comments Created 4 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: chromeos/audio/cras_audio_handler_unittest.cc
diff --git a/chromeos/audio/cras_audio_handler_unittest.cc b/chromeos/audio/cras_audio_handler_unittest.cc
index 7375b4dfa8f0c94e72e3eef31fa6e7789fdfbb4d..b543d6808ec1e18e0bc73313fe4b930949678497 100644
--- a/chromeos/audio/cras_audio_handler_unittest.cc
+++ b/chromeos/audio/cras_audio_handler_unittest.cc
@@ -1976,7 +1976,7 @@ TEST_F(CrasAudioHandlerTest, SetOutputVolumePercent) {
// Verify the output volume is changed to the designated value,
// OnOutputNodeVolumeChanged event is fired, and the device volume value
- // is saved the preferences.
+ // is saved in the preferences.
const int kVolume = 60;
EXPECT_EQ(kVolume, cras_audio_handler_->GetOutputVolumePercent());
EXPECT_EQ(1, test_observer_->output_volume_changed_count());
@@ -1986,6 +1986,25 @@ TEST_F(CrasAudioHandlerTest, SetOutputVolumePercent) {
EXPECT_EQ(kVolume, audio_pref_handler_->GetOutputVolumeValue(&device));
}
+TEST_F(CrasAudioHandlerTest, SetOutputVolumePercentWithoutNotifyingObservers) {
+ AudioNodeList audio_nodes;
+ audio_nodes.push_back(kInternalSpeaker);
+ SetUpCrasAudioHandler(audio_nodes);
+ EXPECT_EQ(0, test_observer_->output_volume_changed_count());
+
+ cras_audio_handler_->SetOutputVolumePercentWithoutNotifyingObservers(60);
+ // Verify the output volume is changed to the designated value,
+ // OnOutputNodeVolumeChanged event is not fired, and the device volume value
+ // is saved in the preferences.
+ const int kVolume = 60;
Daniel Erat 2016/07/29 17:53:38 move this constant up and use it in the SetOutputV
Qiang(Joe) Xu 2016/07/29 18:58:23 Done.
+ EXPECT_EQ(kVolume, cras_audio_handler_->GetOutputVolumePercent());
+ EXPECT_EQ(0, test_observer_->output_volume_changed_count());
+ AudioDevice device;
+ EXPECT_TRUE(cras_audio_handler_->GetPrimaryActiveOutputDevice(&device));
+ EXPECT_EQ(device.id, kInternalSpeaker.id);
+ EXPECT_EQ(kVolume, audio_pref_handler_->GetOutputVolumeValue(&device));
Daniel Erat 2016/07/29 17:53:38 please also test that further updates _do_ cause n
Qiang(Joe) Xu 2016/07/29 18:58:23 Done.
+}
+
TEST_F(CrasAudioHandlerTest, SetOutputVolumeWithDelayedSignal) {
AudioNodeList audio_nodes;
audio_nodes.push_back(kInternalSpeaker);
« chromeos/audio/cras_audio_handler.cc ('K') | « chromeos/audio/cras_audio_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698