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

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

Issue 2818513003: [Mojo Video Capture] Adapt video_capture service to refactored video capture stack (Closed)
Patch Set: Fix compile errors 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_factory.cc ('k') | services/video_capture/test/mock_device_test.cc » ('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.h
diff --git a/services/video_capture/test/mock_device_test.h b/services/video_capture/test/mock_device_test.h
index 1133118ccd53e9c1d2608f4cae3057be74c01256..637f635fb34df9b5fc33c818e42f626c7cbd15b8 100644
--- a/services/video_capture/test/mock_device_test.h
+++ b/services/video_capture/test/mock_device_test.h
@@ -19,17 +19,24 @@ class MessageLoop;
namespace video_capture {
+// To ensure correct operation, this mock device holds on to the |client|
+// that is passed to it in AllocateAndStart() and releases it on
+// StopAndDeAllocate().
class MockDevice : public media::VideoCaptureDevice {
public:
MockDevice();
~MockDevice() override;
+ void SendStubFrame(const media::VideoCaptureFormat& format,
+ int rotation,
+ int frame_id);
+
// media::VideoCaptureDevice:
MOCK_METHOD2(DoAllocateAndStart,
void(const media::VideoCaptureParams& params,
std::unique_ptr<Client>* client));
MOCK_METHOD0(RequestRefreshFrame, void());
- MOCK_METHOD0(StopAndDeAllocate, void());
+ MOCK_METHOD0(DoStopAndDeAllocate, void());
MOCK_METHOD1(DoGetPhotoCapabilities,
void(GetPhotoCapabilitiesCallback* callback));
MOCK_METHOD2(DoSetPhotoOptions,
@@ -41,10 +48,14 @@ class MockDevice : public media::VideoCaptureDevice {
void AllocateAndStart(const media::VideoCaptureParams& params,
std::unique_ptr<Client> client) override;
+ void StopAndDeAllocate() override;
void GetPhotoCapabilities(GetPhotoCapabilitiesCallback callback) override;
void SetPhotoOptions(media::mojom::PhotoSettingsPtr settings,
SetPhotoOptionsCallback callback) override;
void TakePhoto(TakePhotoCallback callback) override;
+
+ private:
+ std::unique_ptr<Client> client_;
};
// Reusable test setup for testing with a single mock device.
« no previous file with comments | « services/video_capture/test/mock_device_factory.cc ('k') | services/video_capture/test/mock_device_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698