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

Unified Diff: services/video_capture/mock_device_unittest.cc

Issue 2457003002: [Mojo Video Capture] Simplify API and some cleanups (Closed)
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 side-by-side diff with in-line comments
Download patch
Index: services/video_capture/mock_device_unittest.cc
diff --git a/services/video_capture/mock_device_video_capture_service_unittest.cc b/services/video_capture/mock_device_unittest.cc
similarity index 55%
rename from services/video_capture/mock_device_video_capture_service_unittest.cc
rename to services/video_capture/mock_device_unittest.cc
index 1e44ca9580cd41090c09cb05fde89248a5553c10..d859af20cd1f3f472091ebf975358310c79d6c06 100644
--- a/services/video_capture/mock_device_video_capture_service_unittest.cc
+++ b/services/video_capture/mock_device_unittest.cc
@@ -3,26 +3,23 @@
// found in the LICENSE file.
#include "base/run_loop.h"
-#include "services/video_capture/mock_device_video_capture_service_test.h"
+#include "services/video_capture/mock_device_test.h"
using testing::_;
-using testing::InvokeWithoutArgs;
+using testing::Invoke;
namespace video_capture {
// Tests that the service stops the capture device when the client closes the
// connection to the device proxy.
-TEST_F(MockDeviceVideoCaptureServiceTest,
- DeviceIsStoppedWhenDiscardingDeviceProxy) {
+TEST_F(MockDeviceTest, DeviceIsStoppedWhenDiscardingDeviceProxy) {
base::RunLoop wait_loop;
EXPECT_CALL(*mock_device_, AllocateAndStartPtr(_));
EXPECT_CALL(*mock_device_, StopAndDeAllocate())
- .WillOnce(InvokeWithoutArgs([&wait_loop]() { wait_loop.Quit(); }));
+ .WillOnce(Invoke([&wait_loop]() { wait_loop.Quit(); }));
- device_proxy_->Start(requested_format_,
- media::RESOLUTION_POLICY_FIXED_RESOLUTION,
- media::PowerLineFrequency::FREQUENCY_DEFAULT,
+ device_proxy_->Start(requested_settings_,
std::move(mock_receiver_proxy_));
device_proxy_.reset();
@@ -31,17 +28,14 @@ TEST_F(MockDeviceVideoCaptureServiceTest,
// Tests that the service stops the capture device when the client closes the
// connection to the client proxy it provided to the service.
-TEST_F(MockDeviceVideoCaptureServiceTest,
- DeviceIsStoppedWhenDiscardingDeviceClient) {
+TEST_F(MockDeviceTest, DeviceIsStoppedWhenDiscardingDeviceClient) {
base::RunLoop wait_loop;
EXPECT_CALL(*mock_device_, AllocateAndStartPtr(_));
EXPECT_CALL(*mock_device_, StopAndDeAllocate())
- .WillOnce(InvokeWithoutArgs([&wait_loop]() { wait_loop.Quit(); }));
+ .WillOnce(Invoke([&wait_loop]() { wait_loop.Quit(); }));
- device_proxy_->Start(requested_format_,
- media::RESOLUTION_POLICY_FIXED_RESOLUTION,
- media::PowerLineFrequency::FREQUENCY_DEFAULT,
+ device_proxy_->Start(requested_settings_,
std::move(mock_receiver_proxy_));
mock_receiver_.reset();
« no previous file with comments | « services/video_capture/mock_device_test.cc ('k') | services/video_capture/mock_device_video_capture_service_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698