Alex Vakulenko | e4eec20 | 2017-01-27 14:41:04 -0800 | [diff] [blame] | 1 | #ifndef ANDROID_PDX_MOCK_CLIENT_CHANNEL_H_ |
| 2 | #define ANDROID_PDX_MOCK_CLIENT_CHANNEL_H_ |
| 3 | |
| 4 | #include <gmock/gmock.h> |
| 5 | #include <pdx/client_channel.h> |
| 6 | |
| 7 | namespace android { |
| 8 | namespace pdx { |
| 9 | |
| 10 | class MockClientChannel : public ClientChannel { |
| 11 | public: |
| 12 | MOCK_CONST_METHOD0(GetIpcTag, uint32_t()); |
| 13 | MOCK_CONST_METHOD0(event_fd, int()); |
Corey Tabaka | 52ea25c | 2017-09-13 18:02:48 -0700 | [diff] [blame^] | 14 | MOCK_CONST_METHOD0(GetEventSources, std::vector<EventSource>()); |
Corey Tabaka | 6890d95 | 2017-01-19 15:02:59 -0800 | [diff] [blame] | 15 | MOCK_METHOD1(GetEventMask, Status<int>(int)); |
Alex Vakulenko | e4eec20 | 2017-01-27 14:41:04 -0800 | [diff] [blame] | 16 | MOCK_METHOD0(GetChannelHandle, LocalChannelHandle&()); |
| 17 | MOCK_METHOD0(AllocateTransactionState, void*()); |
| 18 | MOCK_METHOD1(FreeTransactionState, void(void* state)); |
| 19 | MOCK_METHOD3(SendImpulse, |
| 20 | Status<void>(int opcode, const void* buffer, size_t length)); |
| 21 | MOCK_METHOD6(SendWithInt, |
| 22 | Status<int>(void* transaction_state, int opcode, |
| 23 | const iovec* send_vector, size_t send_count, |
| 24 | const iovec* receive_vector, size_t receive_count)); |
| 25 | MOCK_METHOD6(SendWithFileHandle, |
| 26 | Status<LocalHandle>(void* transaction_state, int opcode, |
| 27 | const iovec* send_vector, size_t send_count, |
| 28 | const iovec* receive_vector, |
| 29 | size_t receive_count)); |
| 30 | MOCK_METHOD6(SendWithChannelHandle, |
| 31 | Status<LocalChannelHandle>(void* transaction_state, int opcode, |
| 32 | const iovec* send_vector, |
| 33 | size_t send_count, |
| 34 | const iovec* receive_vector, |
| 35 | size_t receive_count)); |
| 36 | MOCK_METHOD2(PushFileHandle, FileReference(void* transaction_state, |
| 37 | const LocalHandle& handle)); |
| 38 | MOCK_METHOD2(PushFileHandle, FileReference(void* transaction_state, |
| 39 | const BorrowedHandle& handle)); |
| 40 | MOCK_METHOD2(PushChannelHandle, |
| 41 | ChannelReference(void* transaction_state, |
| 42 | const LocalChannelHandle& handle)); |
| 43 | MOCK_METHOD2(PushChannelHandle, |
| 44 | ChannelReference(void* transaction_state, |
| 45 | const BorrowedChannelHandle& handle)); |
| 46 | MOCK_CONST_METHOD3(GetFileHandle, |
| 47 | bool(void* transaction_state, FileReference ref, |
| 48 | LocalHandle* handle)); |
| 49 | MOCK_CONST_METHOD3(GetChannelHandle, |
| 50 | bool(void* transaction_state, ChannelReference ref, |
| 51 | LocalChannelHandle* handle)); |
| 52 | }; |
| 53 | |
| 54 | } // namespace pdx |
| 55 | } // namespace android |
| 56 | |
| 57 | #endif // ANDROID_PDX_MOCK_CLIENT_CHANNEL_H_ |