Darin Petkov | 633ac6f | 2011-07-08 13:56:13 -0700 | [diff] [blame] | 1 | // Copyright (c) 2011 The Chromium OS Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef SHILL_MOCK_SOCKETS_H_ |
| 6 | #define SHILL_MOCK_SOCKETS_H_ |
| 7 | |
Darin Petkov | ef34f18 | 2011-08-26 14:14:40 -0700 | [diff] [blame] | 8 | #include <base/basictypes.h> |
Darin Petkov | 633ac6f | 2011-07-08 13:56:13 -0700 | [diff] [blame] | 9 | #include <gmock/gmock.h> |
| 10 | |
| 11 | #include "shill/sockets.h" |
| 12 | |
| 13 | namespace shill { |
| 14 | |
| 15 | class MockSockets : public Sockets { |
| 16 | public: |
Darin Petkov | ef34f18 | 2011-08-26 14:14:40 -0700 | [diff] [blame] | 17 | MockSockets(); |
| 18 | virtual ~MockSockets(); |
| 19 | |
Darin Petkov | 633ac6f | 2011-07-08 13:56:13 -0700 | [diff] [blame] | 20 | MOCK_METHOD3(Bind, |
| 21 | int(int sockfd, const struct sockaddr *addr, socklen_t addrlen)); |
| 22 | MOCK_METHOD1(Close, int(int fd)); |
Darin Petkov | e0a312e | 2011-07-20 13:45:28 -0700 | [diff] [blame] | 23 | MOCK_METHOD3(Ioctl, int(int d, int request, void *argp)); |
Darin Petkov | 633ac6f | 2011-07-08 13:56:13 -0700 | [diff] [blame] | 24 | MOCK_METHOD4(Send, |
| 25 | ssize_t(int sockfd, const void *buf, size_t len, int flags)); |
| 26 | MOCK_METHOD6(SendTo, ssize_t(int sockfd, |
| 27 | const void *buf, |
| 28 | size_t len, |
| 29 | int flags, |
| 30 | const struct sockaddr *dest_addr, |
| 31 | socklen_t addrlen)); |
| 32 | MOCK_METHOD3(Socket, int(int domain, int type, int protocol)); |
Darin Petkov | ef34f18 | 2011-08-26 14:14:40 -0700 | [diff] [blame] | 33 | |
| 34 | private: |
| 35 | DISALLOW_COPY_AND_ASSIGN(MockSockets); |
Darin Petkov | 633ac6f | 2011-07-08 13:56:13 -0700 | [diff] [blame] | 36 | }; |
| 37 | |
| 38 | } // namespace shill |
| 39 | |
| 40 | #endif // SHILL_MOCK_SOCKETS_H_ |