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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 base::ThreadTaskRunnerHandle::Get()); | 146 base::ThreadTaskRunnerHandle::Get()); |
147 video_capture_manager_->RegisterListener(nullptr); | |
148 video_capture_device_factory_ = static_cast<MockVideoCaptureDeviceFactory*>( | 147 video_capture_device_factory_ = static_cast<MockVideoCaptureDeviceFactory*>( |
149 video_capture_manager_->video_capture_device_factory()); | 148 video_capture_manager_->video_capture_device_factory()); |
150 media_devices_manager_.reset(new MediaDevicesManager( | 149 media_devices_manager_.reset(new MediaDevicesManager( |
151 audio_manager_.get(), video_capture_manager_, nullptr)); | 150 audio_manager_.get(), video_capture_manager_, nullptr)); |
152 } | 151 } |
153 | 152 |
154 void EnableCache(MediaDeviceType type) { | 153 void EnableCache(MediaDeviceType type) { |
155 media_devices_manager_->SetCachePolicy( | 154 media_devices_manager_->SetCachePolicy( |
156 type, MediaDevicesManager::CachePolicy::SYSTEM_MONITOR); | 155 type, MediaDevicesManager::CachePolicy::SYSTEM_MONITOR); |
157 } | 156 } |
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
567 media_devices_manager_->OnDevicesChanged(base::SystemMonitor::DEVTYPE_AUDIO); | 566 media_devices_manager_->OnDevicesChanged(base::SystemMonitor::DEVTYPE_AUDIO); |
568 media_devices_manager_->OnDevicesChanged( | 567 media_devices_manager_->OnDevicesChanged( |
569 base::SystemMonitor::DEVTYPE_VIDEO_CAPTURE); | 568 base::SystemMonitor::DEVTYPE_VIDEO_CAPTURE); |
570 base::RunLoop().RunUntilIdle(); | 569 base::RunLoop().RunUntilIdle(); |
571 EXPECT_EQ(num_audio_input_devices, notification_all_audio_input.size()); | 570 EXPECT_EQ(num_audio_input_devices, notification_all_audio_input.size()); |
572 EXPECT_EQ(num_video_input_devices, notification_all_video_input.size()); | 571 EXPECT_EQ(num_video_input_devices, notification_all_video_input.size()); |
573 EXPECT_EQ(num_audio_output_devices, notification_all_audio_output.size()); | 572 EXPECT_EQ(num_audio_output_devices, notification_all_audio_output.size()); |
574 } | 573 } |
575 | 574 |
576 } // namespace content | 575 } // namespace content |
OLD | NEW |