Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(564)

Side by Side Diff: services/video_capture/fake_device_video_capture_service_test.cc

Issue 2238083004: Video Capture Mojo (1.4b): Implement ability to use fake device instance (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@FillServicePart1
Patch Set: mcasas' comments Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "services/video_capture/fake_device_video_capture_service_test.h"
6
7 #include "base/run_loop.h"
8
9 using testing::_;
10 using testing::Invoke;
11
12 namespace video_capture {
13
14 FakeDeviceVideoCaptureServiceTest::FakeDeviceVideoCaptureServiceTest()
15 : VideoCaptureServiceTest() {}
16
17 FakeDeviceVideoCaptureServiceTest::~FakeDeviceVideoCaptureServiceTest() =
18 default;
19
20 void FakeDeviceVideoCaptureServiceTest::SetUp() {
21 VideoCaptureServiceTest::SetUp();
22
23 base::RunLoop wait_loop;
24 mojom::VideoCaptureDeviceDescriptorPtr fake_device_descriptor;
25 EXPECT_CALL(descriptor_receiver_, OnEnumerateDeviceDescriptorsCallback(_))
26 .WillOnce(Invoke([&wait_loop, &fake_device_descriptor](
27 const std::vector<mojom::VideoCaptureDeviceDescriptorPtr>&
28 descriptors) {
29 fake_device_descriptor = descriptors[0].Clone();
30 wait_loop.Quit();
31 }));
32 factory_->EnumerateDeviceDescriptors(base::Bind(
33 &MockDeviceDescriptorReceiver::HandleEnumerateDeviceDescriptorsCallback,
34 base::Unretained(&descriptor_receiver_)));
35 wait_loop.Run();
36
37 factory_->CreateDeviceProxy(
38 std::move(fake_device_descriptor), mojo::GetProxy(&fake_device_proxy_),
39 base::Bind([](mojom::DeviceAccessResultCode result_code) {
40 ASSERT_EQ(mojom::DeviceAccessResultCode::SUCCESS, result_code);
41 }));
42 }
43
44 } // namespace video_capture
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698