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

Side by Side Diff: components/video_capture/mock_stream_client.h

Issue 1637793004: [WIP] Mojo Video Capture thingy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: heave!! Created 4 years, 10 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 COMPONENTS_VIDEO_CAPTURE_MOCK_STREAM_CLIENT_H_
6 #define COMPONENTS_VIDEO_CAPTURE_MOCK_STREAM_CLIENT_H_
7
8 #include "components/video_capture/public/cpp/stream_client_impl.h"
9 #include "testing/gmock/include/gmock/gmock.h"
10
11 namespace video_capture {
12
13 class MockStreamClient : public mojom::StreamClient {
14 public:
15 MockStreamClient();
16 ~MockStreamClient();
17
18 // mojom::StreamClient. Use forwarders for move only types, see
19 // https://github.com/google/googletest/issues/395
20 MOCK_METHOD2(DoFrameAvailable,
21 void(mojom::FrameInfo* info,
22 const FrameAvailableCallback& callback));
23 void FrameAvailable(mojom::FrameInfoPtr info,
24 const FrameAvailableCallback& callback) override {
25 DoFrameAvailable(info.get(), callback);
26 callback.Run();
27 }
28
29 MOCK_METHOD1(DoError, void(const mojo::String& error));
30 void Error(const mojo::String& error) override {
31 DVLOG(1) << __FUNCTION__;
32 DoError(error);
33 }
34
35 mojom::StreamClientPtr CreateProxy() {
36 DCHECK(!binding_.is_bound());
37 mojom::StreamClientPtr le_client = binding_.CreateInterfacePtrAndBind();
38 DCHECK(binding_.is_bound());
39 binding_.EnableTestingMode();
40 return le_client;
41 }
42
43 private:
44 mojo::Binding<mojom::StreamClient> binding_;
45
46 DISALLOW_COPY_AND_ASSIGN(MockStreamClient);
47 };
48
49 } // namespace video_capture
50
51 #endif // COMPONENTS_VIDEO_CAPTURE_MOCK_STREAM_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698