OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "media/capture/video/fake_video_capture_device.h" | 5 #include "media/capture/video/fake_video_capture_device.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 } | 185 } |
186 | 186 |
187 std::unique_ptr<VideoCaptureDevice::Names> EnumerateDevices() { | 187 std::unique_ptr<VideoCaptureDevice::Names> EnumerateDevices() { |
188 VideoCaptureDevice::Names* names; | 188 VideoCaptureDevice::Names* names; |
189 EXPECT_CALL(*device_enumeration_listener_.get(), | 189 EXPECT_CALL(*device_enumeration_listener_.get(), |
190 OnEnumeratedDevicesCallbackPtr(_)).WillOnce(SaveArg<0>(&names)); | 190 OnEnumeratedDevicesCallbackPtr(_)).WillOnce(SaveArg<0>(&names)); |
191 | 191 |
192 video_capture_device_factory_->EnumerateDeviceNames( | 192 video_capture_device_factory_->EnumerateDeviceNames( |
193 base::Bind(&DeviceEnumerationListener::OnEnumeratedDevicesCallback, | 193 base::Bind(&DeviceEnumerationListener::OnEnumeratedDevicesCallback, |
194 device_enumeration_listener_)); | 194 device_enumeration_listener_)); |
195 base::MessageLoop::current()->RunUntilIdle(); | 195 base::RunLoop().RunUntilIdle(); |
196 return std::unique_ptr<VideoCaptureDevice::Names>(names); | 196 return std::unique_ptr<VideoCaptureDevice::Names>(names); |
197 } | 197 } |
198 | 198 |
199 const VideoCaptureFormat& last_format() const { return last_format_; } | 199 const VideoCaptureFormat& last_format() const { return last_format_; } |
200 | 200 |
201 VideoCaptureDevice::Names names_; | 201 VideoCaptureDevice::Names names_; |
202 const std::unique_ptr<base::MessageLoop> loop_; | 202 const std::unique_ptr<base::MessageLoop> loop_; |
203 std::unique_ptr<base::RunLoop> run_loop_; | 203 std::unique_ptr<base::RunLoop> run_loop_; |
204 std::unique_ptr<MockClient> client_; | 204 std::unique_ptr<MockClient> client_; |
205 const scoped_refptr<DeviceEnumerationListener> device_enumeration_listener_; | 205 const scoped_refptr<DeviceEnumerationListener> device_enumeration_listener_; |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 } | 327 } |
328 } | 328 } |
329 | 329 |
330 INSTANTIATE_TEST_CASE_P(, | 330 INSTANTIATE_TEST_CASE_P(, |
331 FakeVideoCaptureDeviceCommandLineTest, | 331 FakeVideoCaptureDeviceCommandLineTest, |
332 Values(CommandLineTestData{"fps=-1", 5}, | 332 Values(CommandLineTestData{"fps=-1", 5}, |
333 CommandLineTestData{"fps=29.97", 29.97f}, | 333 CommandLineTestData{"fps=29.97", 29.97f}, |
334 CommandLineTestData{"fps=60", 60}, | 334 CommandLineTestData{"fps=60", 60}, |
335 CommandLineTestData{"fps=1000", 60})); | 335 CommandLineTestData{"fps=1000", 60})); |
336 }; // namespace media | 336 }; // namespace media |
OLD | NEW |