• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #ifndef ANDROID_PDX_MOCK_ENDPOINT_H_
2 #define ANDROID_PDX_MOCK_ENDPOINT_H_
3 
4 #include <gmock/gmock.h>
5 #include <pdx/service_endpoint.h>
6 
7 namespace android {
8 namespace pdx {
9 
10 class MockEndpoint : public Endpoint {
11  public:
12   MOCK_CONST_METHOD0(GetIpcTag, uint32_t());
13   MOCK_METHOD1(SetService, Status<void>(Service* service));
14   MOCK_METHOD2(SetChannel, Status<void>(int channel_id, Channel* channel));
15   MOCK_METHOD1(CloseChannel, Status<void>(int channel_id));
16   MOCK_METHOD3(ModifyChannelEvents,
17                Status<void>(int channel_id, int clear_mask, int set_mask));
18   MOCK_METHOD4(PushChannel,
19                Status<RemoteChannelHandle>(Message* message, int flags,
20                                            Channel* channel, int* channel_id));
21   MOCK_METHOD3(CheckChannel,
22                Status<int>(const Message* message, ChannelReference ref,
23                            Channel** channel));
24   MOCK_METHOD1(MessageReceive, Status<void>(Message* message));
25   MOCK_METHOD2(MessageReply, Status<void>(Message* message, int return_code));
26   MOCK_METHOD2(MessageReplyFd,
27                Status<void>(Message* message, unsigned int push_fd));
28   MOCK_METHOD2(MessageReplyChannelHandle,
29                Status<void>(Message* message,
30                             const LocalChannelHandle& handle));
31   MOCK_METHOD2(MessageReplyChannelHandle,
32                Status<void>(Message* message,
33                             const BorrowedChannelHandle& handle));
34   MOCK_METHOD2(MessageReplyChannelHandle,
35                Status<void>(Message* message,
36                             const RemoteChannelHandle& handle));
37   MOCK_METHOD3(ReadMessageData,
38                Status<size_t>(Message* message, const iovec* vector,
39                               size_t vector_length));
40   MOCK_METHOD3(WriteMessageData,
41                Status<size_t>(Message* message, const iovec* vector,
42                               size_t vector_length));
43   MOCK_METHOD2(PushFileHandle,
44                Status<FileReference>(Message* message,
45                                      const LocalHandle& handle));
46   MOCK_METHOD2(PushFileHandle,
47                Status<FileReference>(Message* message,
48                                      const BorrowedHandle& handle));
49   MOCK_METHOD2(PushFileHandle,
50                Status<FileReference>(Message* message,
51                                      const RemoteHandle& handle));
52   MOCK_METHOD2(PushChannelHandle,
53                Status<ChannelReference>(Message* message,
54                                         const LocalChannelHandle& handle));
55   MOCK_METHOD2(PushChannelHandle,
56                Status<ChannelReference>(Message* message,
57                                         const BorrowedChannelHandle& handle));
58   MOCK_METHOD2(PushChannelHandle,
59                Status<ChannelReference>(Message* message,
60                                         const RemoteChannelHandle& handle));
61   MOCK_CONST_METHOD2(GetFileHandle,
62                      LocalHandle(Message* message, FileReference ref));
63   MOCK_CONST_METHOD2(GetChannelHandle,
64                      LocalChannelHandle(Message* message,
65                                         ChannelReference ref));
66   MOCK_METHOD0(AllocateMessageState, void*());
67   MOCK_METHOD1(FreeMessageState, void(void* state));
68   MOCK_METHOD0(Cancel, Status<void>());
69   MOCK_CONST_METHOD0(epoll_fd, int());
70 };
71 
72 }  // namespace pdx
73 }  // namespace android
74 
75 #endif  // ANDROID_PDX_MOCK_ENDPOINT_H_
76