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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 void EnumerateCallback(base::RunLoop* run_loop, | 134 void EnumerateCallback(base::RunLoop* run_loop, |
135 const MediaDeviceEnumeration& result) { | 135 const MediaDeviceEnumeration& result) { |
136 MockCallback(result); | 136 MockCallback(result); |
137 run_loop->Quit(); | 137 run_loop->Quit(); |
138 } | 138 } |
139 | 139 |
140 protected: | 140 protected: |
141 void SetUp() override { | 141 void SetUp() override { |
142 audio_manager_.reset(new MockAudioManager()); | 142 audio_manager_.reset(new MockAudioManager()); |
143 video_capture_manager_ = new VideoCaptureManager( | 143 video_capture_manager_ = new VideoCaptureManager( |
144 std::unique_ptr<media::VideoCaptureDeviceFactory>( | 144 base::MakeUnique<media::VideoCaptureSystem>( |
145 new MockVideoCaptureDeviceFactory()), | 145 std::unique_ptr<media::VideoCaptureDeviceFactory>( |
| 146 new MockVideoCaptureDeviceFactory())), |
146 base::ThreadTaskRunnerHandle::Get()); | 147 base::ThreadTaskRunnerHandle::Get()); |
147 video_capture_device_factory_ = static_cast<MockVideoCaptureDeviceFactory*>( | 148 video_capture_device_factory_ = static_cast<MockVideoCaptureDeviceFactory*>( |
148 video_capture_manager_->video_capture_device_factory()); | 149 video_capture_manager_->video_capture_device_factory()); |
149 media_devices_manager_.reset(new MediaDevicesManager( | 150 media_devices_manager_.reset(new MediaDevicesManager( |
150 audio_manager_.get(), video_capture_manager_, nullptr)); | 151 audio_manager_.get(), video_capture_manager_, nullptr)); |
151 } | 152 } |
152 | 153 |
153 void EnableCache(MediaDeviceType type) { | 154 void EnableCache(MediaDeviceType type) { |
154 media_devices_manager_->SetCachePolicy( | 155 media_devices_manager_->SetCachePolicy( |
155 type, MediaDevicesManager::CachePolicy::SYSTEM_MONITOR); | 156 type, MediaDevicesManager::CachePolicy::SYSTEM_MONITOR); |
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
566 media_devices_manager_->OnDevicesChanged(base::SystemMonitor::DEVTYPE_AUDIO); | 567 media_devices_manager_->OnDevicesChanged(base::SystemMonitor::DEVTYPE_AUDIO); |
567 media_devices_manager_->OnDevicesChanged( | 568 media_devices_manager_->OnDevicesChanged( |
568 base::SystemMonitor::DEVTYPE_VIDEO_CAPTURE); | 569 base::SystemMonitor::DEVTYPE_VIDEO_CAPTURE); |
569 base::RunLoop().RunUntilIdle(); | 570 base::RunLoop().RunUntilIdle(); |
570 EXPECT_EQ(num_audio_input_devices, notification_all_audio_input.size()); | 571 EXPECT_EQ(num_audio_input_devices, notification_all_audio_input.size()); |
571 EXPECT_EQ(num_video_input_devices, notification_all_video_input.size()); | 572 EXPECT_EQ(num_video_input_devices, notification_all_video_input.size()); |
572 EXPECT_EQ(num_audio_output_devices, notification_all_audio_output.size()); | 573 EXPECT_EQ(num_audio_output_devices, notification_all_audio_output.size()); |
573 } | 574 } |
574 | 575 |
575 } // namespace content | 576 } // namespace content |
OLD | NEW |