blob: d5740bbf0e5eb75ee07e29ba54b93ac270cf1cd3 [file] [log] [blame]
Wade Guthriecc53f232013-03-05 13:22:23 -08001// 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 Guthriefa2100e2013-05-15 10:11:22 -07008#include "shill/netlink_socket.h"
Wade Guthriecc53f232013-03-05 13:22:23 -08009
Wade Guthrie89e6cb32013-03-07 08:03:45 -080010#include <base/basictypes.h>
Wade Guthriecc53f232013-03-05 13:22:23 -080011
12#include <gmock/gmock.h>
13
Wade Guthriecc53f232013-03-05 13:22:23 -080014namespace shill {
15
16class ByteString;
17
18class MockNetlinkSocket : public NetlinkSocket {
19 public:
20 MockNetlinkSocket() {}
21 MOCK_METHOD0(Init, bool());
22
Wade Guthriecc53f232013-03-05 13:22:23 -080023 uint32 GetLastSequenceNumber() const { return sequence_number_; }
Wade Guthriefa2100e2013-05-15 10:11:22 -070024 MOCK_CONST_METHOD0(file_descriptor, int());
25 MOCK_METHOD1(SendMessage, bool(const ByteString &out_string));
Wade Guthriebee87c22013-03-06 11:00:46 -080026 MOCK_METHOD1(SubscribeToEvents, bool(uint32_t group_id));
Wade Guthriefa2100e2013-05-15 10:11:22 -070027 MOCK_METHOD1(RecvMessage, bool(ByteString *message));
Wade Guthriecc53f232013-03-05 13:22:23 -080028
29 private:
30 DISALLOW_COPY_AND_ASSIGN(MockNetlinkSocket);
31};
32
33} // namespace shill
34
35#endif // SHILL_MOCK_NETLINK_SOCKET_H_