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

Side by Side Diff: media/capture/service/mock_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 and magjed@s comments 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 unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef MEDIA_CAPTURE_SERVICE_MOCK_STREAM_CLIENT_H_
6 #define MEDIA_CAPTURE_SERVICE_MOCK_STREAM_CLIENT_H_
7
8 #include "media/capture/interfaces/video_capture.mojom.h"
9 #include "mojo/public/cpp/bindings/binding.h"
10 #include "testing/gmock/include/gmock/gmock.h"
11
12 namespace media {
13
14 class MockStreamClient : public mojom::VideoCaptureStreamClient {
15 public:
16 MockStreamClient();
17 ~MockStreamClient();
18
19 // mojom::VideoCaptureStreamClient. Use forwarders for move only types, see
20 // https://github.com/google/googletest/issues/395
21 MOCK_METHOD2(DoOnFrameAvailable,
22 void(mojom::FrameInfo* info,
23 const OnFrameAvailableCallback& callback));
24 void OnFrameAvailable(mojom::FrameInfoPtr info,
25 const OnFrameAvailableCallback& callback) override {
26 DoOnFrameAvailable(info.get(), callback);
27 callback.Run();
28 }
29 MOCK_METHOD1(OnError, void(const mojo::String& error));
30
31 mojom::VideoCaptureStreamClientPtr CreateProxy() {
32 DCHECK(!binding_.is_bound());
33 return binding_.CreateInterfacePtrAndBind();
34 }
35
36 private:
37 mojo::Binding<mojom::VideoCaptureStreamClient> binding_;
38
39 DISALLOW_COPY_AND_ASSIGN(MockStreamClient);
40 };
41
42 } // namespace media
43
44 #endif // MEDIA_CAPTURE_SERVICE_MOCK_STREAM_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698