OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // Unit test for VideoCaptureManager. | 5 // Unit test for VideoCaptureManager. |
6 | 6 |
7 #include "content/browser/renderer_host/media/video_capture_manager.h" | 7 #include "content/browser/renderer_host/media/video_capture_manager.h" |
8 | 8 |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 devices_ = std::move(devices); | 193 devices_ = std::move(devices); |
194 quit_closure.Run(); | 194 quit_closure.Run(); |
195 } | 195 } |
196 | 196 |
197 protected: | 197 protected: |
198 void SetUp() override { | 198 void SetUp() override { |
199 listener_.reset(new MockMediaStreamProviderListener()); | 199 listener_.reset(new MockMediaStreamProviderListener()); |
200 auto video_capture_device_factory = | 200 auto video_capture_device_factory = |
201 base::MakeUnique<WrappedDeviceFactory>(); | 201 base::MakeUnique<WrappedDeviceFactory>(); |
202 video_capture_device_factory_ = video_capture_device_factory.get(); | 202 video_capture_device_factory_ = video_capture_device_factory.get(); |
203 auto video_capture_system = base::MakeUnique<media::VideoCaptureSystem>( | 203 auto video_capture_system = base::MakeUnique<media::VideoCaptureSystemImpl>( |
204 std::move(video_capture_device_factory)); | 204 std::move(video_capture_device_factory)); |
205 vcm_ = new VideoCaptureManager(std::move(video_capture_system), | 205 vcm_ = new VideoCaptureManager(std::move(video_capture_system), |
206 base::ThreadTaskRunnerHandle::Get()); | 206 base::ThreadTaskRunnerHandle::Get()); |
207 const int32_t kNumberOfFakeDevices = 2; | 207 const int32_t kNumberOfFakeDevices = 2; |
208 video_capture_device_factory_->SetToDefaultDevicesConfig( | 208 video_capture_device_factory_->SetToDefaultDevicesConfig( |
209 kNumberOfFakeDevices); | 209 kNumberOfFakeDevices); |
210 vcm_->RegisterListener(listener_.get()); | 210 vcm_->RegisterListener(listener_.get()); |
211 frame_observer_.reset(new MockFrameObserver()); | 211 frame_observer_.reset(new MockFrameObserver()); |
212 | 212 |
213 base::RunLoop run_loop; | 213 base::RunLoop run_loop; |
(...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
787 // Wait to check callbacks before removing the listener. | 787 // Wait to check callbacks before removing the listener. |
788 base::RunLoop().RunUntilIdle(); | 788 base::RunLoop().RunUntilIdle(); |
789 vcm_->UnregisterListener(listener_.get()); | 789 vcm_->UnregisterListener(listener_.get()); |
790 } | 790 } |
791 #endif | 791 #endif |
792 | 792 |
793 // TODO(mcasas): Add a test to check consolidation of the supported formats | 793 // TODO(mcasas): Add a test to check consolidation of the supported formats |
794 // provided by the device when http://crbug.com/323913 is closed. | 794 // provided by the device when http://crbug.com/323913 is closed. |
795 | 795 |
796 } // namespace content | 796 } // namespace content |
OLD | NEW |