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 "services/video_capture/test/fake_device_descriptor_test.h" | 5 #include "services/video_capture/test/fake_device_descriptor_test.h" |
6 | 6 |
7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
8 | 8 |
9 using testing::_; | 9 using testing::_; |
10 using testing::Invoke; | 10 using testing::Invoke; |
11 | 11 |
12 namespace video_capture { | 12 namespace video_capture { |
13 | 13 |
14 FakeDeviceDescriptorTest::FakeDeviceDescriptorTest() | 14 FakeDeviceDescriptorTest::FakeDeviceDescriptorTest() |
15 : video_capture::ServiceTest() {} | 15 : video_capture::ServiceTest() {} |
16 | 16 |
17 FakeDeviceDescriptorTest::~FakeDeviceDescriptorTest() = default; | 17 FakeDeviceDescriptorTest::~FakeDeviceDescriptorTest() = default; |
18 | 18 |
19 void FakeDeviceDescriptorTest::SetUp() { | 19 void FakeDeviceDescriptorTest::SetUp() { |
20 video_capture::ServiceTest::SetUp(); | 20 video_capture::ServiceTest::SetUp(); |
21 | 21 |
22 base::RunLoop wait_loop; | 22 base::RunLoop wait_loop; |
23 EXPECT_CALL(descriptor_receiver_, Run(_)) | 23 EXPECT_CALL(device_info_receiver_, Run(_)) |
24 .WillOnce(Invoke([this, &wait_loop]( | 24 .WillOnce( |
25 const std::vector<media::VideoCaptureDeviceDescriptor>& descriptors) { | 25 Invoke([this, &wait_loop]( |
26 fake_device_descriptor_ = descriptors[0]; | 26 const std::vector<media::VideoCaptureDeviceInfo>& infos) { |
27 wait_loop.Quit(); | 27 fake_device_info_ = infos[0]; |
28 })); | 28 wait_loop.Quit(); |
29 factory_->EnumerateDeviceDescriptors(descriptor_receiver_.Get()); | 29 })); |
| 30 factory_->GetDeviceInfos(device_info_receiver_.Get()); |
30 wait_loop.Run(); | 31 wait_loop.Run(); |
31 } | 32 } |
32 | 33 |
33 } // namespace video_capture | 34 } // namespace video_capture |
OLD | NEW |