| 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 OnNewBufferHandle(int32_t buffer_id, | 21 void OnIncomingCapturedVideoFrame(media::mojom::VideoFramePtr frame) override; |
| 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; | |
| 28 | 22 |
| 29 MOCK_METHOD2(DoOnNewBufferHandle, | 23 MOCK_METHOD1(OnIncomingCapturedVideoFramePtr, |
| 30 void(int32_t, mojo::ScopedSharedBufferHandle*)); | 24 void(const media::mojom::VideoFramePtr* frame)); |
| 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)); | |
| 37 MOCK_METHOD0(OnError, void()); | 25 MOCK_METHOD0(OnError, void()); |
| 38 MOCK_METHOD1(OnLog, void(const std::string&)); | 26 MOCK_METHOD1(OnLog, void(const std::string&)); |
| 39 MOCK_METHOD0(OnStarted, void()); | 27 MOCK_METHOD0(OnStarted, void()); |
| 40 MOCK_METHOD0(OnStartedUsingGpuDecode, void()); | 28 MOCK_METHOD1(OnBufferDestroyed, void(int32_t)); |
| 41 | 29 |
| 42 private: | 30 private: |
| 43 const mojo::Binding<mojom::Receiver> binding_; | 31 const mojo::Binding<mojom::Receiver> binding_; |
| 44 }; | 32 }; |
| 45 | 33 |
| 46 } // namespace video_capture | 34 } // namespace video_capture |
| 47 | 35 |
| 48 #endif // SERVICES_VIDEO_CAPTURE_TEST_MOCK_RECEIVER_H_ | 36 #endif // SERVICES_VIDEO_CAPTURE_TEST_MOCK_RECEIVER_H_ |
| OLD | NEW |