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

Unified Diff: chromeos/audio/cras_audio_handler_unittest.cc

Issue 1759103003: Exclude non-simple-usage audio nodes from being selected as primary node, and do not persist their … (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 95660658f5a15621d91d0e664dadcc4d9aaa4cdd..5fadd6f85a3f4eb9713d69f37652eb93848cdb40 100644
--- a/chromeos/audio/cras_audio_handler_unittest.cc
+++ b/chromeos/audio/cras_audio_handler_unittest.cc
@@ -575,6 +575,27 @@ TEST_F(CrasAudioHandlerTest, SetKeyboardMicActive) {
EXPECT_FALSE(inactive_keyboard_mic->active);
}
+TEST_F(CrasAudioHandlerTest, KeyboardMicNotSetAsPrimaryActive) {
+ AudioNodeList audio_nodes;
+ audio_nodes.push_back(kKeyboardMic);
+ SetUpCrasAudioHandler(audio_nodes);
+
+ // Verify keyboard mic is not set as primary active input.
+ AudioDeviceList audio_devices;
+ cras_audio_handler_->GetAudioDevices(&audio_devices);
+ EXPECT_EQ(audio_nodes.size(), audio_devices.size());
+ EXPECT_TRUE(cras_audio_handler_->HasKeyboardMic());
+ EXPECT_EQ(0u, cras_audio_handler_->GetPrimaryActiveInputNode());
+
+ // Verify the internal mic is set as primary input.
+ audio_nodes.push_back(kInternalMic);
+ ChangeAudioNodes(audio_nodes);
+ cras_audio_handler_->GetAudioDevices(&audio_devices);
+ EXPECT_EQ(audio_nodes.size(), audio_devices.size());
+ EXPECT_TRUE(cras_audio_handler_->HasKeyboardMic());
+ EXPECT_EQ(kInternalMic.id, cras_audio_handler_->GetPrimaryActiveInputNode());
+}
+
TEST_F(CrasAudioHandlerTest, SwitchActiveOutputDevice) {
AudioNodeList audio_nodes;
audio_nodes.push_back(kInternalSpeaker);
« no previous file with comments | « chromeos/audio/cras_audio_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698