Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Side by Side Diff: native_client_sdk/src/tests/nacl_io_test/kernel_proxy_mock.h

Issue 23005005: [NaCl SDK] nacl_io: Add initial implementations of kill and signal (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 LIBRARIES_NACL_IO_TEST_KERNEL_PROXY_MOCK_H_ 5 #ifndef LIBRARIES_NACL_IO_TEST_KERNEL_PROXY_MOCK_H_
6 #define LIBRARIES_NACL_IO_TEST_KERNEL_PROXY_MOCK_H_ 6 #define LIBRARIES_NACL_IO_TEST_KERNEL_PROXY_MOCK_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/ossocket.h" 14 #include "nacl_io/ossocket.h"
14 #include "nacl_io/ostermios.h" 15 #include "nacl_io/ostermios.h"
15 16
16 class KernelProxyMock : public nacl_io::KernelProxy { 17 class KernelProxyMock : public nacl_io::KernelProxy {
17 public: 18 public:
18 KernelProxyMock(); 19 KernelProxyMock();
19 virtual ~KernelProxyMock(); 20 virtual ~KernelProxyMock();
20 21
21 MOCK_METHOD2(access, int(const char*, int)); 22 MOCK_METHOD2(access, int(const char*, int));
22 MOCK_METHOD1(chdir, int(const char*)); 23 MOCK_METHOD1(chdir, int(const char*));
23 MOCK_METHOD2(chmod, int(const char*, mode_t)); 24 MOCK_METHOD2(chmod, int(const char*, mode_t));
24 MOCK_METHOD3(chown, int(const char*, uid_t, gid_t)); 25 MOCK_METHOD3(chown, int(const char*, uid_t, gid_t));
25 MOCK_METHOD1(close, int(int)); 26 MOCK_METHOD1(close, int(int));
26 MOCK_METHOD1(dup, int(int)); 27 MOCK_METHOD1(dup, int(int));
27 MOCK_METHOD2(dup2, int(int, int)); 28 MOCK_METHOD2(dup2, int(int, int));
28 MOCK_METHOD3(fchown, int(int, uid_t, gid_t)); 29 MOCK_METHOD3(fchown, int(int, uid_t, gid_t));
29 MOCK_METHOD2(ftruncate, int(int, off_t)); 30 MOCK_METHOD2(ftruncate, int(int, off_t));
30 MOCK_METHOD2(fstat, int(int, struct stat*)); 31 MOCK_METHOD2(fstat, int(int, struct stat*));
31 MOCK_METHOD1(fsync, int(int)); 32 MOCK_METHOD1(fsync, int(int));
32 MOCK_METHOD2(getcwd, char*(char*, size_t)); 33 MOCK_METHOD2(getcwd, char*(char*, size_t));
33 MOCK_METHOD3(getdents, int(int, void*, unsigned int)); 34 MOCK_METHOD3(getdents, int(int, void*, unsigned int));
34 MOCK_METHOD1(getwd, char*(char*)); 35 MOCK_METHOD1(getwd, char*(char*));
35 MOCK_METHOD3(ioctl, int(int, int, char*)); 36 MOCK_METHOD3(ioctl, int(int, int, char*));
36 MOCK_METHOD1(isatty, int(int)); 37 MOCK_METHOD1(isatty, int(int));
38 MOCK_METHOD2(kill, int(int, int));
37 MOCK_METHOD3(lchown, int(const char*, uid_t, gid_t)); 39 MOCK_METHOD3(lchown, int(const char*, uid_t, gid_t));
40 MOCK_METHOD2(link, int(const char*, const char*));
38 MOCK_METHOD3(lseek, off_t(int, off_t, int)); 41 MOCK_METHOD3(lseek, off_t(int, off_t, int));
39 MOCK_METHOD2(mkdir, int(const char*, mode_t)); 42 MOCK_METHOD2(mkdir, int(const char*, mode_t));
43 MOCK_METHOD6(mmap, void*(void*, size_t, int, int, int, size_t));
40 MOCK_METHOD5(mount, int(const char*, const char*, const char*, unsigned long, 44 MOCK_METHOD5(mount, int(const char*, const char*, const char*, unsigned long,
41 const void*)); 45 const void*));
42 MOCK_METHOD2(open, int(const char*, int)); 46 MOCK_METHOD2(open, int(const char*, int));
43 MOCK_METHOD3(read, ssize_t(int, void*, size_t)); 47 MOCK_METHOD3(read, ssize_t(int, void*, size_t));
44 MOCK_METHOD1(remove, int(const char*)); 48 MOCK_METHOD1(remove, int(const char*));
45 MOCK_METHOD1(rmdir, int(const char*)); 49 MOCK_METHOD1(rmdir, int(const char*));
50 MOCK_METHOD2(signal, sighandler_t(int, sighandler_t));
51 MOCK_METHOD2(sigset, sighandler_t(int, sighandler_t));
46 MOCK_METHOD2(stat, int(const char*, struct stat*)); 52 MOCK_METHOD2(stat, int(const char*, struct stat*));
53 MOCK_METHOD2(symlink, int(const char*, const char*));
47 MOCK_METHOD2(tcgetattr, int(int, struct termios*)); 54 MOCK_METHOD2(tcgetattr, int(int, struct termios*));
48 MOCK_METHOD3(tcsetattr, int(int, int, const struct termios*)); 55 MOCK_METHOD3(tcsetattr, int(int, int, const struct termios*));
49 MOCK_METHOD1(umount, int(const char*)); 56 MOCK_METHOD1(umount, int(const char*));
50 MOCK_METHOD1(unlink, int(const char*)); 57 MOCK_METHOD1(unlink, int(const char*));
51 MOCK_METHOD2(utime, int(const char*, const struct utimbuf*)); 58 MOCK_METHOD2(utime, int(const char*, const struct utimbuf*));
52 MOCK_METHOD3(write, ssize_t(int, const void*, size_t)); 59 MOCK_METHOD3(write, ssize_t(int, const void*, size_t));
53 MOCK_METHOD2(link, int(const char*, const char*));
54 MOCK_METHOD2(symlink, int(const char*, const char*));
55 MOCK_METHOD6(mmap, void*(void*, size_t, int, int, int, size_t));
56 MOCK_METHOD1(open_resource, int(const char*)); 60 MOCK_METHOD1(open_resource, int(const char*));
57 61
58 #ifdef PROVIDES_SOCKET_API 62 #ifdef PROVIDES_SOCKET_API
59 MOCK_METHOD3(poll, int(struct pollfd*, nfds_t, int)); 63 MOCK_METHOD3(poll, int(struct pollfd*, nfds_t, int));
60 MOCK_METHOD5(select, int(int, fd_set*, fd_set*, fd_set*, struct timeval*)); 64 MOCK_METHOD5(select, int(int, fd_set*, fd_set*, fd_set*, struct timeval*));
61 65
62 // Socket support functions 66 // Socket support functions
63 MOCK_METHOD3(accept, int(int, struct sockaddr*, socklen_t*)); 67 MOCK_METHOD3(accept, int(int, struct sockaddr*, socklen_t*));
64 MOCK_METHOD3(bind, int(int, const struct sockaddr*, socklen_t)); 68 MOCK_METHOD3(bind, int(int, const struct sockaddr*, socklen_t));
65 MOCK_METHOD3(connect, int(int, const struct sockaddr*, socklen_t)); 69 MOCK_METHOD3(connect, int(int, const struct sockaddr*, socklen_t));
(...skipping 12 matching lines...) Expand all
78 MOCK_METHOD3(sendmsg, ssize_t(int, const struct msghdr*, int)); 82 MOCK_METHOD3(sendmsg, ssize_t(int, const struct msghdr*, int));
79 MOCK_METHOD5(setsockopt, int(int, int, int, const void*, socklen_t)); 83 MOCK_METHOD5(setsockopt, int(int, int, int, const void*, socklen_t));
80 MOCK_METHOD2(shutdown, int(int, int)); 84 MOCK_METHOD2(shutdown, int(int, int));
81 MOCK_METHOD3(socket, int(int, int, int)); 85 MOCK_METHOD3(socket, int(int, int, int));
82 MOCK_METHOD4(socketpair, int(int, int, int, int*)); 86 MOCK_METHOD4(socketpair, int(int, int, int, int*));
83 #endif // PROVIDES_SOCKET_API 87 #endif // PROVIDES_SOCKET_API
84 88
85 }; 89 };
86 90
87 #endif // LIBRARIES_NACL_IO_TEST_KERNEL_PROXY_MOCK_H_ 91 #endif // LIBRARIES_NACL_IO_TEST_KERNEL_PROXY_MOCK_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698