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