Wade Guthrie | cc53f23 | 2013-03-05 13:22:23 -0800 | [diff] [blame] | 1 | // Copyright (c) 2012 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_NETLINK_SOCKET_H_ |
| 6 | #define SHILL_MOCK_NETLINK_SOCKET_H_ |
| 7 | |
Wade Guthrie | fa2100e | 2013-05-15 10:11:22 -0700 | [diff] [blame] | 8 | #include "shill/netlink_socket.h" |
Wade Guthrie | cc53f23 | 2013-03-05 13:22:23 -0800 | [diff] [blame] | 9 | |
Wade Guthrie | 89e6cb3 | 2013-03-07 08:03:45 -0800 | [diff] [blame] | 10 | #include <base/basictypes.h> |
Wade Guthrie | cc53f23 | 2013-03-05 13:22:23 -0800 | [diff] [blame] | 11 | |
| 12 | #include <gmock/gmock.h> |
| 13 | |
Wade Guthrie | cc53f23 | 2013-03-05 13:22:23 -0800 | [diff] [blame] | 14 | namespace shill { |
| 15 | |
| 16 | class ByteString; |
| 17 | |
| 18 | class MockNetlinkSocket : public NetlinkSocket { |
| 19 | public: |
| 20 | MockNetlinkSocket() {} |
| 21 | MOCK_METHOD0(Init, bool()); |
| 22 | |
Wade Guthrie | cc53f23 | 2013-03-05 13:22:23 -0800 | [diff] [blame] | 23 | uint32 GetLastSequenceNumber() const { return sequence_number_; } |
Wade Guthrie | fa2100e | 2013-05-15 10:11:22 -0700 | [diff] [blame] | 24 | MOCK_CONST_METHOD0(file_descriptor, int()); |
| 25 | MOCK_METHOD1(SendMessage, bool(const ByteString &out_string)); |
Wade Guthrie | bee87c2 | 2013-03-06 11:00:46 -0800 | [diff] [blame] | 26 | MOCK_METHOD1(SubscribeToEvents, bool(uint32_t group_id)); |
Wade Guthrie | fa2100e | 2013-05-15 10:11:22 -0700 | [diff] [blame] | 27 | MOCK_METHOD1(RecvMessage, bool(ByteString *message)); |
Wade Guthrie | cc53f23 | 2013-03-05 13:22:23 -0800 | [diff] [blame] | 28 | |
| 29 | private: |
| 30 | DISALLOW_COPY_AND_ASSIGN(MockNetlinkSocket); |
| 31 | }; |
| 32 | |
| 33 | } // namespace shill |
| 34 | |
| 35 | #endif // SHILL_MOCK_NETLINK_SOCKET_H_ |