blob: 7780ee3c16517cbe088bc5421913a3c4be046279 [file] [log] [blame]
Alex Vakulenkoe4eec202017-01-27 14:41:04 -08001#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
7namespace android {
8namespace pdx {
9
10class MockClientChannel : public ClientChannel {
11 public:
12 MOCK_CONST_METHOD0(GetIpcTag, uint32_t());
13 MOCK_CONST_METHOD0(event_fd, int());
14 MOCK_METHOD0(GetChannelHandle, LocalChannelHandle&());
15 MOCK_METHOD0(AllocateTransactionState, void*());
16 MOCK_METHOD1(FreeTransactionState, void(void* state));
17 MOCK_METHOD3(SendImpulse,
18 Status<void>(int opcode, const void* buffer, size_t length));
19 MOCK_METHOD6(SendWithInt,
20 Status<int>(void* transaction_state, int opcode,
21 const iovec* send_vector, size_t send_count,
22 const iovec* receive_vector, size_t receive_count));
23 MOCK_METHOD6(SendWithFileHandle,
24 Status<LocalHandle>(void* transaction_state, int opcode,
25 const iovec* send_vector, size_t send_count,
26 const iovec* receive_vector,
27 size_t receive_count));
28 MOCK_METHOD6(SendWithChannelHandle,
29 Status<LocalChannelHandle>(void* transaction_state, int opcode,
30 const iovec* send_vector,
31 size_t send_count,
32 const iovec* receive_vector,
33 size_t receive_count));
34 MOCK_METHOD2(PushFileHandle, FileReference(void* transaction_state,
35 const LocalHandle& handle));
36 MOCK_METHOD2(PushFileHandle, FileReference(void* transaction_state,
37 const BorrowedHandle& handle));
38 MOCK_METHOD2(PushChannelHandle,
39 ChannelReference(void* transaction_state,
40 const LocalChannelHandle& handle));
41 MOCK_METHOD2(PushChannelHandle,
42 ChannelReference(void* transaction_state,
43 const BorrowedChannelHandle& handle));
44 MOCK_CONST_METHOD3(GetFileHandle,
45 bool(void* transaction_state, FileReference ref,
46 LocalHandle* handle));
47 MOCK_CONST_METHOD3(GetChannelHandle,
48 bool(void* transaction_state, ChannelReference ref,
49 LocalChannelHandle* handle));
50};
51
52} // namespace pdx
53} // namespace android
54
55#endif // ANDROID_PDX_MOCK_CLIENT_CHANNEL_H_