blob: b1a12996c5e715da9b9399e5092a27e82b8e100c [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());
Corey Tabaka52ea25c2017-09-13 18:02:48 -070014 MOCK_CONST_METHOD0(GetEventSources, std::vector<EventSource>());
Corey Tabaka6890d952017-01-19 15:02:59 -080015 MOCK_METHOD1(GetEventMask, Status<int>(int));
Alex Vakulenkoe4eec202017-01-27 14:41:04 -080016 MOCK_METHOD0(GetChannelHandle, LocalChannelHandle&());
Jiwen 'Steve' Caia8049a22018-03-28 15:14:02 -070017 MOCK_CONST_METHOD0(GetChannelHandle, const LocalChannelHandle&());
Alex Vakulenkoe4eec202017-01-27 14:41:04 -080018 MOCK_METHOD0(AllocateTransactionState, void*());
19 MOCK_METHOD1(FreeTransactionState, void(void* state));
20 MOCK_METHOD3(SendImpulse,
21 Status<void>(int opcode, const void* buffer, size_t length));
22 MOCK_METHOD6(SendWithInt,
23 Status<int>(void* transaction_state, int opcode,
24 const iovec* send_vector, size_t send_count,
25 const iovec* receive_vector, size_t receive_count));
26 MOCK_METHOD6(SendWithFileHandle,
27 Status<LocalHandle>(void* transaction_state, int opcode,
28 const iovec* send_vector, size_t send_count,
29 const iovec* receive_vector,
30 size_t receive_count));
31 MOCK_METHOD6(SendWithChannelHandle,
32 Status<LocalChannelHandle>(void* transaction_state, int opcode,
33 const iovec* send_vector,
34 size_t send_count,
35 const iovec* receive_vector,
36 size_t receive_count));
37 MOCK_METHOD2(PushFileHandle, FileReference(void* transaction_state,
38 const LocalHandle& handle));
39 MOCK_METHOD2(PushFileHandle, FileReference(void* transaction_state,
40 const BorrowedHandle& handle));
41 MOCK_METHOD2(PushChannelHandle,
42 ChannelReference(void* transaction_state,
43 const LocalChannelHandle& handle));
44 MOCK_METHOD2(PushChannelHandle,
45 ChannelReference(void* transaction_state,
46 const BorrowedChannelHandle& handle));
47 MOCK_CONST_METHOD3(GetFileHandle,
48 bool(void* transaction_state, FileReference ref,
49 LocalHandle* handle));
50 MOCK_CONST_METHOD3(GetChannelHandle,
51 bool(void* transaction_state, ChannelReference ref,
52 LocalChannelHandle* handle));
Jiwen 'Steve' Caia88e3ee2017-11-03 17:33:33 -070053 MOCK_METHOD0(TakeChannelParcelable, std::unique_ptr<ChannelParcelable>());
Alex Vakulenkoe4eec202017-01-27 14:41:04 -080054};
55
56} // namespace pdx
57} // namespace android
58
59#endif // ANDROID_PDX_MOCK_CLIENT_CHANNEL_H_