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

Unified Diff: media/capture/service/mock_video_capture_stream_client.h

Issue 1699553002: Mojo Video Capture service in media/capture (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: perkj@s comments and renaming Created 4 years, 9 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 | « media/capture/service/OWNERS ('k') | media/capture/service/mock_video_capture_stream_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/capture/service/mock_video_capture_stream_client.h
diff --git a/media/capture/service/mock_video_capture_stream_client.h b/media/capture/service/mock_video_capture_stream_client.h
new file mode 100644
index 0000000000000000000000000000000000000000..3b6c58f017448ae691c8d7ccf2d57e283c686185
--- /dev/null
+++ b/media/capture/service/mock_video_capture_stream_client.h
@@ -0,0 +1,44 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef MEDIA_CAPTURE_SERVICE_MOCK_VIDEO_CAPTURE_STREAM_CLIENT_H_
+#define MEDIA_CAPTURE_SERVICE_MOCK_VIDEO_CAPTURE_STREAM_CLIENT_H_
+
+#include "media/capture/interfaces/video_capture.mojom.h"
+#include "mojo/public/cpp/bindings/binding.h"
+#include "testing/gmock/include/gmock/gmock.h"
+
+namespace media {
+
+class MockVideoCaptureStreamClient : public mojom::VideoCaptureStreamClient {
+ public:
+ MockVideoCaptureStreamClient();
+ ~MockVideoCaptureStreamClient();
+
+ // mojom::VideoCaptureStreamClient. Use forwarders for move only types, see
+ // https://github.com/google/googletest/issues/395
+ MOCK_METHOD2(DoOnFrameAvailable,
+ void(mojom::FrameInfo* info,
+ const OnFrameAvailableCallback& callback));
+ void OnFrameAvailable(mojom::FrameInfoPtr info,
+ const OnFrameAvailableCallback& callback) override {
+ DoOnFrameAvailable(info.get(), callback);
+ callback.Run();
+ }
+ MOCK_METHOD1(OnError, void(const mojo::String& error));
+
+ mojom::VideoCaptureStreamClientPtr CreateProxy() {
+ DCHECK(!binding_.is_bound());
+ return binding_.CreateInterfacePtrAndBind();
+ }
+
+ private:
+ mojo::Binding<mojom::VideoCaptureStreamClient> binding_;
+
+ DISALLOW_COPY_AND_ASSIGN(MockVideoCaptureStreamClient);
+};
+
+} // namespace media
+
+#endif // MEDIA_CAPTURE_SERVICE_MOCK_VIDEO_CAPTURE_STREAM_CLIENT_H_
« no previous file with comments | « media/capture/service/OWNERS ('k') | media/capture/service/mock_video_capture_stream_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698