| 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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 std::unique_ptr<media::VideoCaptureDeviceFactory>( |
| 145 new MockVideoCaptureDeviceFactory())); | 145 new MockVideoCaptureDeviceFactory()), |
| 146 video_capture_manager_->Register(nullptr, | 146 base::ThreadTaskRunnerHandle::Get()); |
| 147 base::ThreadTaskRunnerHandle::Get()); | 147 video_capture_manager_->RegisterListener(nullptr); |
| 148 video_capture_device_factory_ = static_cast<MockVideoCaptureDeviceFactory*>( | 148 video_capture_device_factory_ = static_cast<MockVideoCaptureDeviceFactory*>( |
| 149 video_capture_manager_->video_capture_device_factory()); | 149 video_capture_manager_->video_capture_device_factory()); |
| 150 media_devices_manager_.reset(new MediaDevicesManager( | 150 media_devices_manager_.reset(new MediaDevicesManager( |
| 151 audio_manager_.get(), video_capture_manager_, nullptr)); | 151 audio_manager_.get(), video_capture_manager_, nullptr)); |
| 152 } | 152 } |
| 153 | 153 |
| 154 void EnableCache(MediaDeviceType type) { | 154 void EnableCache(MediaDeviceType type) { |
| 155 media_devices_manager_->SetCachePolicy( | 155 media_devices_manager_->SetCachePolicy( |
| 156 type, MediaDevicesManager::CachePolicy::SYSTEM_MONITOR); | 156 type, MediaDevicesManager::CachePolicy::SYSTEM_MONITOR); |
| 157 } | 157 } |
| (...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 560 media_devices_manager_->OnDevicesChanged(base::SystemMonitor::DEVTYPE_AUDIO); | 560 media_devices_manager_->OnDevicesChanged(base::SystemMonitor::DEVTYPE_AUDIO); |
| 561 media_devices_manager_->OnDevicesChanged( | 561 media_devices_manager_->OnDevicesChanged( |
| 562 base::SystemMonitor::DEVTYPE_VIDEO_CAPTURE); | 562 base::SystemMonitor::DEVTYPE_VIDEO_CAPTURE); |
| 563 base::RunLoop().RunUntilIdle(); | 563 base::RunLoop().RunUntilIdle(); |
| 564 EXPECT_EQ(num_audio_input_devices, notification_all_audio_input.size()); | 564 EXPECT_EQ(num_audio_input_devices, notification_all_audio_input.size()); |
| 565 EXPECT_EQ(num_video_input_devices, notification_all_video_input.size()); | 565 EXPECT_EQ(num_video_input_devices, notification_all_video_input.size()); |
| 566 EXPECT_EQ(num_audio_output_devices, notification_all_audio_output.size()); | 566 EXPECT_EQ(num_audio_output_devices, notification_all_audio_output.size()); |
| 567 } | 567 } |
| 568 | 568 |
| 569 } // namespace content | 569 } // namespace content |
| OLD | NEW |