| 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 "base/run_loop.h" | 9 #include "base/run_loop.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 audio_nodes); | 106 audio_nodes); |
| 107 base::RunLoop().RunUntilIdle(); | 107 base::RunLoop().RunUntilIdle(); |
| 108 } | 108 } |
| 109 | 109 |
| 110 protected: | 110 protected: |
| 111 base::MessageLoopForUI message_loop_; | 111 base::MessageLoopForUI message_loop_; |
| 112 chromeos::CrasAudioHandler* cras_audio_handler_; // Not owned. | 112 chromeos::CrasAudioHandler* cras_audio_handler_; // Not owned. |
| 113 chromeos::FakeCrasAudioClient* fake_cras_audio_client_; // Not owned. | 113 chromeos::FakeCrasAudioClient* fake_cras_audio_client_; // Not owned. |
| 114 }; | 114 }; |
| 115 | 115 |
| 116 IN_PROC_BROWSER_TEST_F(AudioApiTest, AudioV1StableId) { | 116 IN_PROC_BROWSER_TEST_F(AudioApiTest, Audio) { |
| 117 // Set up the audio nodes for testing. | |
| 118 AudioNodeList audio_nodes = { | |
| 119 CreateAudioNode(kJabraSpeaker1, 1), CreateAudioNode(kJabraSpeaker2, 1), | |
| 120 CreateAudioNode(kHDMIOutput, 1), CreateAudioNode(kJabraMic1, 1), | |
| 121 CreateAudioNode(kJabraMic2, 1), CreateAudioNode(kUSBCameraMic, 1)}; | |
| 122 | |
| 123 SetUpCrasAudioHandlerWithTestingNodes(audio_nodes); | |
| 124 | |
| 125 EXPECT_TRUE(RunAppTest("api_test/audio")) << message_; | |
| 126 } | |
| 127 | |
| 128 IN_PROC_BROWSER_TEST_F(AudioApiTest, AudioV2StableId) { | |
| 129 // Set up the audio nodes for testing. | 117 // Set up the audio nodes for testing. |
| 130 AudioNodeList audio_nodes = { | 118 AudioNodeList audio_nodes = { |
| 131 CreateAudioNode(kJabraSpeaker1, 2), CreateAudioNode(kJabraSpeaker2, 2), | 119 CreateAudioNode(kJabraSpeaker1, 2), CreateAudioNode(kJabraSpeaker2, 2), |
| 132 CreateAudioNode(kHDMIOutput, 2), CreateAudioNode(kJabraMic1, 2), | 120 CreateAudioNode(kHDMIOutput, 2), CreateAudioNode(kJabraMic1, 2), |
| 133 CreateAudioNode(kJabraMic2, 2), CreateAudioNode(kUSBCameraMic, 2)}; | 121 CreateAudioNode(kJabraMic2, 2), CreateAudioNode(kUSBCameraMic, 2)}; |
| 134 | 122 |
| 135 SetUpCrasAudioHandlerWithTestingNodes(audio_nodes); | 123 SetUpCrasAudioHandlerWithTestingNodes(audio_nodes); |
| 136 | 124 |
| 137 EXPECT_TRUE(RunAppTest("api_test/audio")) << message_; | 125 EXPECT_TRUE(RunAppTest("api_test/audio")) << message_; |
| 138 } | 126 } |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 EXPECT_EQ(init_device_size - 1, audio_devices.size()); | 265 EXPECT_EQ(init_device_size - 1, audio_devices.size()); |
| 278 | 266 |
| 279 // Verify the background app got the onNodesChanged event | 267 // Verify the background app got the onNodesChanged event |
| 280 // with the last node removed. | 268 // with the last node removed. |
| 281 EXPECT_TRUE(result_catcher.GetNextResult()) << result_catcher.message(); | 269 EXPECT_TRUE(result_catcher.GetNextResult()) << result_catcher.message(); |
| 282 } | 270 } |
| 283 | 271 |
| 284 #endif // OS_CHROMEOS | 272 #endif // OS_CHROMEOS |
| 285 | 273 |
| 286 } // namespace extensions | 274 } // namespace extensions |
| OLD | NEW |