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

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

Issue 2386183002: Replace manual conversions with Mojo type mappings
Patch Set: Created 4 years, 2 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
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/fake_device_descriptor_test.h" 5 #include "services/video_capture/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 : VideoCaptureServiceTest() {} 15 : VideoCaptureServiceTest() {}
16 16
17 FakeDeviceDescriptorTest::~FakeDeviceDescriptorTest() = default; 17 FakeDeviceDescriptorTest::~FakeDeviceDescriptorTest() = default;
18 18
19 void FakeDeviceDescriptorTest::SetUp() { 19 void FakeDeviceDescriptorTest::SetUp() {
20 VideoCaptureServiceTest::SetUp(); 20 VideoCaptureServiceTest::SetUp();
21 21
22 base::RunLoop wait_loop; 22 base::RunLoop wait_loop;
23 EXPECT_CALL(descriptor_receiver_, OnEnumerateDeviceDescriptorsCallback(_)) 23 EXPECT_CALL(descriptor_receiver_, OnEnumerateDeviceDescriptorsCallback(_))
24 .WillOnce(Invoke([this, &wait_loop]( 24 .WillOnce(Invoke([this, &wait_loop](
25 const std::vector<mojom::VideoCaptureDeviceDescriptorPtr>& 25 const std::vector<media::VideoCaptureDeviceDescriptor>& descriptors) {
26 descriptors) { 26 fake_device_descriptor_ = descriptors[0];
27 fake_device_descriptor_ = descriptors[0].Clone();
28 wait_loop.Quit(); 27 wait_loop.Quit();
29 })); 28 }));
30 factory_->EnumerateDeviceDescriptors(base::Bind( 29 factory_->EnumerateDeviceDescriptors(base::Bind(
31 &MockDeviceDescriptorReceiver::HandleEnumerateDeviceDescriptorsCallback, 30 &MockDeviceDescriptorReceiver::OnEnumerateDeviceDescriptorsCallback,
32 base::Unretained(&descriptor_receiver_))); 31 base::Unretained(&descriptor_receiver_)));
33 wait_loop.Run(); 32 wait_loop.Run();
34 } 33 }
35 34
36 } // namespace video_capture 35 } // namespace video_capture
OLDNEW
« no previous file with comments | « services/video_capture/fake_device_descriptor_test.h ('k') | services/video_capture/fake_device_descriptor_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698