OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef TESTS_NACL_IO_TEST_MOCK_KERNEL_PROXY_H_ | 5 #ifndef TESTS_NACL_IO_TEST_MOCK_KERNEL_PROXY_H_ |
6 #define TESTS_NACL_IO_TEST_MOCK_KERNEL_PROXY_H_ | 6 #define TESTS_NACL_IO_TEST_MOCK_KERNEL_PROXY_H_ |
7 | 7 |
8 #include <sys/types.h> | 8 #include <sys/types.h> |
9 #include <sys/stat.h> | 9 #include <sys/stat.h> |
10 #include "gmock/gmock.h" | 10 #include "gmock/gmock.h" |
11 | 11 |
12 #include "nacl_io/kernel_proxy.h" | 12 #include "nacl_io/kernel_proxy.h" |
13 #include "nacl_io/ossignal.h" | 13 #include "nacl_io/ossignal.h" |
14 #include "nacl_io/ossocket.h" | 14 #include "nacl_io/ossocket.h" |
15 #include "nacl_io/ostermios.h" | 15 #include "nacl_io/ostermios.h" |
16 | 16 |
17 class MockKernelProxy : public nacl_io::KernelProxy { | 17 class MockKernelProxy : public nacl_io::KernelProxy { |
18 public: | 18 public: |
19 MockKernelProxy() {} | 19 MockKernelProxy() {} |
20 | 20 |
21 MOCK_METHOD2(access, int(const char*, int)); | 21 MOCK_METHOD2(access, int(const char*, int)); |
22 MOCK_METHOD1(chdir, int(const char*)); | 22 MOCK_METHOD1(chdir, int(const char*)); |
23 MOCK_METHOD2(chmod, int(const char*, mode_t)); | 23 MOCK_METHOD2(chmod, int(const char*, mode_t)); |
24 MOCK_METHOD3(chown, int(const char*, uid_t, gid_t)); | 24 MOCK_METHOD3(chown, int(const char*, uid_t, gid_t)); |
25 MOCK_METHOD1(close, int(int)); | 25 MOCK_METHOD1(close, int(int)); |
26 MOCK_METHOD1(dup, int(int)); | 26 MOCK_METHOD1(dup, int(int)); |
27 MOCK_METHOD2(dup2, int(int, int)); | 27 MOCK_METHOD2(dup2, int(int, int)); |
28 MOCK_METHOD1(fchdir, int(int)); | 28 MOCK_METHOD1(fchdir, int(int)); |
29 MOCK_METHOD2(fchmod, int(int, int)); | 29 MOCK_METHOD2(fchmod, int(int, mode_t)); |
30 MOCK_METHOD3(fchown, int(int, uid_t, gid_t)); | 30 MOCK_METHOD3(fchown, int(int, uid_t, gid_t)); |
31 MOCK_METHOD3(fcntl, int(int, int, va_list)); | 31 MOCK_METHOD3(fcntl, int(int, int, va_list)); |
32 MOCK_METHOD1(fdatasync, int(int)); | 32 MOCK_METHOD1(fdatasync, int(int)); |
33 MOCK_METHOD2(ftruncate, int(int, off_t)); | 33 MOCK_METHOD2(ftruncate, int(int, off_t)); |
34 MOCK_METHOD2(fstat, int(int, struct stat*)); | 34 MOCK_METHOD2(fstat, int(int, struct stat*)); |
35 MOCK_METHOD1(fsync, int(int)); | 35 MOCK_METHOD1(fsync, int(int)); |
36 MOCK_METHOD2(futimens, int(int, const struct timespec[2])); | 36 MOCK_METHOD2(futimens, int(int, const struct timespec[2])); |
37 MOCK_METHOD2(getcwd, char*(char*, size_t)); | 37 MOCK_METHOD2(getcwd, char*(char*, size_t)); |
38 MOCK_METHOD3(getdents, int(int, void*, unsigned int)); | 38 MOCK_METHOD3(getdents, int(int, void*, unsigned int)); |
39 MOCK_METHOD1(getwd, char*(char*)); | 39 MOCK_METHOD1(getwd, char*(char*)); |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 const struct sockaddr*, socklen_t)); | 91 const struct sockaddr*, socklen_t)); |
92 MOCK_METHOD3(sendmsg, ssize_t(int, const struct msghdr*, int)); | 92 MOCK_METHOD3(sendmsg, ssize_t(int, const struct msghdr*, int)); |
93 MOCK_METHOD5(setsockopt, int(int, int, int, const void*, socklen_t)); | 93 MOCK_METHOD5(setsockopt, int(int, int, int, const void*, socklen_t)); |
94 MOCK_METHOD2(shutdown, int(int, int)); | 94 MOCK_METHOD2(shutdown, int(int, int)); |
95 MOCK_METHOD3(socket, int(int, int, int)); | 95 MOCK_METHOD3(socket, int(int, int, int)); |
96 MOCK_METHOD4(socketpair, int(int, int, int, int*)); | 96 MOCK_METHOD4(socketpair, int(int, int, int, int*)); |
97 #endif // PROVIDES_SOCKET_API | 97 #endif // PROVIDES_SOCKET_API |
98 }; | 98 }; |
99 | 99 |
100 #endif // TESTS_NACL_IO_TEST_MOCK_KERNEL_PROXY_H_ | 100 #endif // TESTS_NACL_IO_TEST_MOCK_KERNEL_PROXY_H_ |
OLD | NEW |