OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef SERVICES_VIDEO_CAPTURE_TEST_MOCK_RECEIVER_H_ | 5 #ifndef SERVICES_VIDEO_CAPTURE_TEST_MOCK_RECEIVER_H_ |
6 #define SERVICES_VIDEO_CAPTURE_TEST_MOCK_RECEIVER_H_ | 6 #define SERVICES_VIDEO_CAPTURE_TEST_MOCK_RECEIVER_H_ |
7 | 7 |
8 #include "media/mojo/interfaces/media_types.mojom.h" | 8 #include "media/mojo/interfaces/media_types.mojom.h" |
9 #include "mojo/public/cpp/bindings/binding.h" | 9 #include "mojo/public/cpp/bindings/binding.h" |
10 #include "services/video_capture/public/interfaces/receiver.mojom.h" | 10 #include "services/video_capture/public/interfaces/receiver.mojom.h" |
11 #include "testing/gmock/include/gmock/gmock.h" | 11 #include "testing/gmock/include/gmock/gmock.h" |
12 | 12 |
13 namespace video_capture { | 13 namespace video_capture { |
14 | 14 |
15 class MockReceiver : public mojom::Receiver { | 15 class MockReceiver : public mojom::Receiver { |
16 public: | 16 public: |
17 MockReceiver(mojom::ReceiverRequest request); | 17 MockReceiver(mojom::ReceiverRequest request); |
18 ~MockReceiver() override; | 18 ~MockReceiver() override; |
19 | 19 |
20 // Use forwarding method to work around gmock not supporting move-only types. | 20 // Use forwarding method to work around gmock not supporting move-only types. |
21 void OnIncomingCapturedVideoFrame(media::mojom::VideoFramePtr frame) override; | 21 void OnNewBufferHandle(int32_t buffer_id, |
| 22 mojo::ScopedSharedBufferHandle buffer_handle) override; |
| 23 void OnFrameReadyInBuffer( |
| 24 int32_t buffer_id, |
| 25 int32_t frame_feedback_id, |
| 26 mojom::ScopedAccessPermissionPtr access_permission, |
| 27 media::mojom::VideoFrameInfoPtr frame_info) override; |
22 | 28 |
23 MOCK_METHOD1(OnIncomingCapturedVideoFramePtr, | 29 MOCK_METHOD2(DoOnNewBufferHandle, |
24 void(const media::mojom::VideoFramePtr* frame)); | 30 void(int32_t, mojo::ScopedSharedBufferHandle*)); |
| 31 MOCK_METHOD4(DoOnFrameReadyInBuffer, |
| 32 void(int32_t buffer_id, |
| 33 int32_t frame_feedback_id, |
| 34 mojom::ScopedAccessPermissionPtr*, |
| 35 media::mojom::VideoFrameInfoPtr*)); |
| 36 MOCK_METHOD1(OnBufferRetired, void(int32_t)); |
25 MOCK_METHOD0(OnError, void()); | 37 MOCK_METHOD0(OnError, void()); |
26 MOCK_METHOD1(OnLog, void(const std::string&)); | 38 MOCK_METHOD1(OnLog, void(const std::string&)); |
27 MOCK_METHOD0(OnStarted, void()); | 39 MOCK_METHOD0(OnStarted, void()); |
28 MOCK_METHOD1(OnBufferDestroyed, void(int32_t)); | 40 MOCK_METHOD0(OnStartedUsingGpuDecode, void()); |
29 | 41 |
30 private: | 42 private: |
31 const mojo::Binding<mojom::Receiver> binding_; | 43 const mojo::Binding<mojom::Receiver> binding_; |
32 }; | 44 }; |
33 | 45 |
34 } // namespace video_capture | 46 } // namespace video_capture |
35 | 47 |
36 #endif // SERVICES_VIDEO_CAPTURE_TEST_MOCK_RECEIVER_H_ | 48 #endif // SERVICES_VIDEO_CAPTURE_TEST_MOCK_RECEIVER_H_ |
OLD | NEW |