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

Unified Diff: chromeos/audio/audio_devices_pref_handler_impl_unittest.cc

Issue 2189463004: Fix the corner case for new audio device is not selected as active if it is plugged in for the firs… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « chromeos/audio/audio_devices_pref_handler_impl.cc ('k') | chromeos/audio/cras_audio_handler.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_impl_unittest.cc
diff --git a/chromeos/audio/audio_devices_pref_handler_impl_unittest.cc b/chromeos/audio/audio_devices_pref_handler_impl_unittest.cc
index ab0205a63c4eb2329a0fa2ab1e69edf4af9c2df8..5f61c7c87fc2d08e3be5669a798f1e990d80a8cb 100644
--- a/chromeos/audio/audio_devices_pref_handler_impl_unittest.cc
+++ b/chromeos/audio/audio_devices_pref_handler_impl_unittest.cc
@@ -20,6 +20,7 @@ namespace chromeos {
const uint64_t kInternalMicId = 10003;
const uint64_t kHeadphoneId = 10002;
const uint64_t kHDMIOutputId = 10006;
+const uint64_t kUSBMicId = 10004;
const uint64_t kOtherTypeOutputId = 90001;
const uint64_t kOtherTypeInputId = 90002;
@@ -31,6 +32,14 @@ const AudioDevice kInternalMic(AudioNode(true,
"Internal Mic",
false,
0));
+const AudioDevice kUSBMic(AudioNode(true,
+ kUSBMicId,
+ kUSBMicId,
+ "Fake USB Mic",
+ "USB",
+ "USB Microphone",
+ false,
+ 0));
const AudioDevice kHeadphone(AudioNode(false,
kHeadphoneId,
@@ -154,6 +163,10 @@ TEST_F(AudioDevicesPrefHandlerTest, TestDeviceStates) {
EXPECT_TRUE(audio_pref_handler_->GetDeviceActive(kHDMIOutput, &active,
&activate_by_user));
EXPECT_FALSE(active);
+
+ // Device not exist in device state prefs.
+ EXPECT_FALSE(audio_pref_handler_->GetDeviceActive(kUSBMic, &active,
+ &activate_by_user));
}
} // namespace chromeos
« no previous file with comments | « chromeos/audio/audio_devices_pref_handler_impl.cc ('k') | chromeos/audio/cras_audio_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698