| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "content/browser/renderer_host/media/media_devices_manager.h" | 5 #include "content/browser/renderer_host/media/media_devices_manager.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 } | 158 } |
| 159 | 159 |
| 160 // Must outlive MediaDevicesManager as ~MediaDevicesManager() verifies it's | 160 // Must outlive MediaDevicesManager as ~MediaDevicesManager() verifies it's |
| 161 // running on the IO thread. | 161 // running on the IO thread. |
| 162 TestBrowserThreadBundle thread_bundle_; | 162 TestBrowserThreadBundle thread_bundle_; |
| 163 | 163 |
| 164 std::unique_ptr<MediaDevicesManager> media_devices_manager_; | 164 std::unique_ptr<MediaDevicesManager> media_devices_manager_; |
| 165 scoped_refptr<VideoCaptureManager> video_capture_manager_; | 165 scoped_refptr<VideoCaptureManager> video_capture_manager_; |
| 166 MockVideoCaptureDeviceFactory* video_capture_device_factory_; | 166 MockVideoCaptureDeviceFactory* video_capture_device_factory_; |
| 167 std::unique_ptr<MockAudioManager, media::AudioManagerDeleter> audio_manager_; | 167 std::unique_ptr<MockAudioManager, media::AudioManagerDeleter> audio_manager_; |
| 168 std::unique_ptr<media::AudioSystem> audio_system_; | 168 media::AudioSystem::UniquePtr audio_system_; |
| 169 | 169 |
| 170 private: | 170 private: |
| 171 DISALLOW_COPY_AND_ASSIGN(MediaDevicesManagerTest); | 171 DISALLOW_COPY_AND_ASSIGN(MediaDevicesManagerTest); |
| 172 }; | 172 }; |
| 173 | 173 |
| 174 TEST_F(MediaDevicesManagerTest, EnumerateNoCacheAudioInput) { | 174 TEST_F(MediaDevicesManagerTest, EnumerateNoCacheAudioInput) { |
| 175 EXPECT_CALL(*audio_manager_, MockGetAudioInputDeviceNames(_)) | 175 EXPECT_CALL(*audio_manager_, MockGetAudioInputDeviceNames(_)) |
| 176 .Times(kNumCalls); | 176 .Times(kNumCalls); |
| 177 EXPECT_CALL(*video_capture_device_factory_, MockGetDeviceDescriptors()) | 177 EXPECT_CALL(*video_capture_device_factory_, MockGetDeviceDescriptors()) |
| 178 .Times(0); | 178 .Times(0); |
| (...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 569 media_devices_manager_->OnDevicesChanged(base::SystemMonitor::DEVTYPE_AUDIO); | 569 media_devices_manager_->OnDevicesChanged(base::SystemMonitor::DEVTYPE_AUDIO); |
| 570 media_devices_manager_->OnDevicesChanged( | 570 media_devices_manager_->OnDevicesChanged( |
| 571 base::SystemMonitor::DEVTYPE_VIDEO_CAPTURE); | 571 base::SystemMonitor::DEVTYPE_VIDEO_CAPTURE); |
| 572 base::RunLoop().RunUntilIdle(); | 572 base::RunLoop().RunUntilIdle(); |
| 573 EXPECT_EQ(num_audio_input_devices, notification_all_audio_input.size()); | 573 EXPECT_EQ(num_audio_input_devices, notification_all_audio_input.size()); |
| 574 EXPECT_EQ(num_video_input_devices, notification_all_video_input.size()); | 574 EXPECT_EQ(num_video_input_devices, notification_all_video_input.size()); |
| 575 EXPECT_EQ(num_audio_output_devices, notification_all_audio_output.size()); | 575 EXPECT_EQ(num_audio_output_devices, notification_all_audio_output.size()); |
| 576 } | 576 } |
| 577 | 577 |
| 578 } // namespace content | 578 } // namespace content |
| OLD | NEW |