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

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

Issue 2457003002: [Mojo Video Capture] Simplify API and some cleanups (Closed)
Patch Set: Created 4 years, 1 month 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
« no previous file with comments | « services/video_capture/BUILD.gn ('k') | services/video_capture/fake_device_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "base/run_loop.h" 5 #include "base/run_loop.h"
6 #include "services/video_capture/fake_device_descriptor_test.h" 6 #include "services/video_capture/fake_device_descriptor_test.h"
7 #include "services/video_capture/mock_video_frame_receiver.h" 7 #include "services/video_capture/mock_video_frame_receiver.h"
8 8
9 using testing::_; 9 using testing::_;
10 using testing::InvokeWithoutArgs; 10 using testing::InvokeWithoutArgs;
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 base::RunLoop wait_loop; 64 base::RunLoop wait_loop;
65 mojom::VideoCaptureDeviceProxyPtr device_proxy_2; 65 mojom::VideoCaptureDeviceProxyPtr device_proxy_2;
66 factory_->CreateDeviceProxy( 66 factory_->CreateDeviceProxy(
67 fake_device_descriptor_->Clone(), mojo::GetProxy(&device_proxy_2), 67 fake_device_descriptor_->Clone(), mojo::GetProxy(&device_proxy_2),
68 base::Bind( 68 base::Bind(
69 [](base::RunLoop* wait_loop, 69 [](base::RunLoop* wait_loop,
70 mojom::DeviceAccessResultCode result_code) { wait_loop->Quit(); }, 70 mojom::DeviceAccessResultCode result_code) { wait_loop->Quit(); },
71 &wait_loop)); 71 &wait_loop));
72 wait_loop.Run(); 72 wait_loop.Run();
73 73
74 media::VideoCaptureFormat arbitrary_requested_format; 74 VideoCaptureSettings arbitrary_requested_settings;
75 arbitrary_requested_format.frame_size.SetSize(640, 480); 75 arbitrary_requested_settings.format.frame_size.SetSize(640, 480);
76 arbitrary_requested_format.frame_rate = 15; 76 arbitrary_requested_settings.format.frame_rate = 15;
77 arbitrary_requested_format.pixel_format = media::PIXEL_FORMAT_I420; 77 arbitrary_requested_settings.resolution_change_policy =
78 arbitrary_requested_format.pixel_storage = media::PIXEL_STORAGE_CPU; 78 media::RESOLUTION_POLICY_FIXED_RESOLUTION;
79 arbitrary_requested_settings.power_line_frequency =
80 media::PowerLineFrequency::FREQUENCY_DEFAULT;
79 81
80 base::RunLoop wait_loop_2; 82 base::RunLoop wait_loop_2;
81 mojom::VideoFrameReceiverPtr receiver_proxy; 83 mojom::VideoFrameReceiverPtr receiver_proxy;
82 MockVideoFrameReceiver receiver(mojo::GetProxy(&receiver_proxy)); 84 MockVideoFrameReceiver receiver(mojo::GetProxy(&receiver_proxy));
83 EXPECT_CALL(receiver, OnIncomingCapturedVideoFramePtr(_)) 85 EXPECT_CALL(receiver, OnIncomingCapturedVideoFramePtr(_))
84 .WillRepeatedly( 86 .WillRepeatedly(
85 InvokeWithoutArgs([&wait_loop_2]() { wait_loop_2.Quit(); })); 87 InvokeWithoutArgs([&wait_loop_2]() { wait_loop_2.Quit(); }));
86 88
87 device_proxy_2->Start(arbitrary_requested_format, 89 device_proxy_2->Start(arbitrary_requested_settings,
88 media::RESOLUTION_POLICY_FIXED_RESOLUTION,
89 media::PowerLineFrequency::FREQUENCY_DEFAULT,
90 std::move(receiver_proxy)); 90 std::move(receiver_proxy));
91 wait_loop_2.Run(); 91 wait_loop_2.Run();
92 } 92 }
93 93
94 } // namespace video_capture 94 } // namespace video_capture
OLDNEW
« no previous file with comments | « services/video_capture/BUILD.gn ('k') | services/video_capture/fake_device_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698