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

Unified Diff: services/video_capture/test/mock_device_test.cc

Issue 2824883005: [Mojo Video Capture] Stop service when last client disconnects. (Closed)
Patch Set: Incorporate suggestions from PatchSet #4 Created 3 years, 8 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
« no previous file with comments | « services/video_capture/test/mock_device_test.h ('k') | services/video_capture/test/service_test.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/video_capture/test/mock_device_test.cc
diff --git a/services/video_capture/test/mock_device_test.cc b/services/video_capture/test/mock_device_test.cc
index 8b526503c50fd0013ab4bbf547fdf63bc6741a8d..d6b66fdcaa7a01ecb0331000d2110c1c1fe1bf09 100644
--- a/services/video_capture/test/mock_device_test.cc
+++ b/services/video_capture/test/mock_device_test.cc
@@ -29,7 +29,7 @@ MockDevice::~MockDevice() = default;
void MockDevice::SendStubFrame(const media::VideoCaptureFormat& format,
int rotation,
- int frame_id) {
+ int frame_feedback_id) {
auto stub_frame = media::VideoFrame::CreateZeroInitializedFrame(
format.pixel_format, format.frame_size,
gfx::Rect(format.frame_size.width(), format.frame_size.height()),
@@ -38,7 +38,8 @@ void MockDevice::SendStubFrame(const media::VideoCaptureFormat& format,
stub_frame->data(0),
static_cast<int>(media::VideoFrame::AllocationSize(
stub_frame->format(), stub_frame->coded_size())),
- format, rotation, base::TimeTicks(), base::TimeDelta(), frame_id);
+ format, rotation, base::TimeTicks(), base::TimeDelta(),
+ frame_feedback_id);
}
void MockDevice::AllocateAndStart(const media::VideoCaptureParams& params,
@@ -65,7 +66,7 @@ void MockDevice::TakePhoto(TakePhotoCallback callback) {
DoTakePhoto(&callback);
}
-MockDeviceTest::MockDeviceTest() = default;
+MockDeviceTest::MockDeviceTest() : ref_factory_(base::Bind(&base::DoNothing)) {}
MockDeviceTest::~MockDeviceTest() = default;
@@ -80,7 +81,8 @@ void MockDeviceTest::SetUp() {
std::move(mock_device_factory));
mock_device_factory_adapter_ =
base::MakeUnique<DeviceFactoryMediaToMojoAdapter>(
- std::move(video_capture_system), base::Bind(CreateJpegDecoder));
+ ref_factory_.CreateRef(), std::move(video_capture_system),
+ base::Bind(CreateJpegDecoder));
mock_factory_binding_ = base::MakeUnique<mojo::Binding<mojom::DeviceFactory>>(
mock_device_factory_adapter_.get(), mojo::MakeRequest(&factory_));
« no previous file with comments | « services/video_capture/test/mock_device_test.h ('k') | services/video_capture/test/service_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698