OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <stddef.h> | 5 #include <stddef.h> |
6 #include <stdint.h> | 6 #include <stdint.h> |
7 | 7 |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
10 #include "extensions/shell/test/shell_apitest.h" | 10 #include "extensions/shell/test/shell_apitest.h" |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 } | 202 } |
203 | 203 |
204 IN_PROC_BROWSER_TEST_F(AudioApiTest, OnInputMuteChanged) { | 204 IN_PROC_BROWSER_TEST_F(AudioApiTest, OnInputMuteChanged) { |
205 AudioNodeList audio_nodes; | 205 AudioNodeList audio_nodes; |
206 audio_nodes.push_back(kJabraMic1); | 206 audio_nodes.push_back(kJabraMic1); |
207 audio_nodes.push_back(kUSBCameraMic); | 207 audio_nodes.push_back(kUSBCameraMic); |
208 SetUpCrasAudioHandlerWithTestingNodes(audio_nodes); | 208 SetUpCrasAudioHandlerWithTestingNodes(audio_nodes); |
209 | 209 |
210 // Set the jabra mic to be the active input device. | 210 // Set the jabra mic to be the active input device. |
211 AudioDevice jabra_mic(kJabraMic1); | 211 AudioDevice jabra_mic(kJabraMic1); |
212 cras_audio_handler_->SwitchToDevice(jabra_mic, true); | 212 cras_audio_handler_->SwitchToDevice( |
| 213 jabra_mic, true, chromeos::CrasAudioHandler::ACTIVATE_BY_USER); |
213 EXPECT_EQ(kJabraMic1.id, cras_audio_handler_->GetPrimaryActiveInputNode()); | 214 EXPECT_EQ(kJabraMic1.id, cras_audio_handler_->GetPrimaryActiveInputNode()); |
214 | 215 |
215 // Un-mute the input. | 216 // Un-mute the input. |
216 cras_audio_handler_->SetInputMute(false); | 217 cras_audio_handler_->SetInputMute(false); |
217 EXPECT_FALSE(cras_audio_handler_->IsInputMuted()); | 218 EXPECT_FALSE(cras_audio_handler_->IsInputMuted()); |
218 | 219 |
219 // Loads background app. | 220 // Loads background app. |
220 ExtensionTestMessageListener load_listener("loaded", false); | 221 ExtensionTestMessageListener load_listener("loaded", false); |
221 ExtensionTestMessageListener result_listener("success", false); | 222 ExtensionTestMessageListener result_listener("success", false); |
222 result_listener.set_failure_message("failure"); | 223 result_listener.set_failure_message("failure"); |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 | 291 |
291 // Verify the background app got the onNodesChanged event | 292 // Verify the background app got the onNodesChanged event |
292 // with the last node removed. | 293 // with the last node removed. |
293 ASSERT_TRUE(result_listener.WaitUntilSatisfied()); | 294 ASSERT_TRUE(result_listener.WaitUntilSatisfied()); |
294 EXPECT_EQ("success", result_listener.message()); | 295 EXPECT_EQ("success", result_listener.message()); |
295 } | 296 } |
296 | 297 |
297 #endif // OS_CHROMEOS | 298 #endif // OS_CHROMEOS |
298 | 299 |
299 } // namespace extensions | 300 } // namespace extensions |
OLD | NEW |