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()); 14 MOCK_CONST_METHOD0(GetEventSources, std::vector<EventSource>()); 15 MOCK_METHOD1(GetEventMask, Status<int>(int)); 16 MOCK_METHOD0(GetChannelHandle, LocalChannelHandle&()); 17 MOCK_CONST_METHOD0(GetChannelHandle, const LocalChannelHandle&()); 18 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)); 53 MOCK_METHOD0(TakeChannelParcelable, std::unique_ptr<ChannelParcelable>()); 54 }; 55 56 } // namespace pdx 57 } // namespace android 58 59 #endif // ANDROID_PDX_MOCK_CLIENT_CHANNEL_H_ 60