Thieu Le | caef893 | 2012-02-28 16:06:59 -0800 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium OS Authors. All rights reserved. |
Paul Stewart | dd60e45 | 2011-08-08 11:38:36 -0700 | [diff] [blame] | 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_ROUTING_TABLE_H_ |
| 6 | #define SHILL_MOCK_ROUTING_TABLE_H_ |
| 7 | |
Darin Petkov | eac68e6 | 2011-08-26 16:24:51 -0700 | [diff] [blame] | 8 | #include <base/basictypes.h> |
Paul Stewart | dd60e45 | 2011-08-08 11:38:36 -0700 | [diff] [blame] | 9 | #include <gmock/gmock.h> |
| 10 | |
| 11 | #include "shill/routing_table.h" |
| 12 | |
| 13 | namespace shill { |
| 14 | |
| 15 | class MockRoutingTable : public RoutingTable { |
| 16 | public: |
Darin Petkov | eac68e6 | 2011-08-26 16:24:51 -0700 | [diff] [blame] | 17 | MockRoutingTable(); |
| 18 | virtual ~MockRoutingTable(); |
| 19 | |
Paul Stewart | dd60e45 | 2011-08-08 11:38:36 -0700 | [diff] [blame] | 20 | MOCK_METHOD0(Start, void()); |
| 21 | MOCK_METHOD0(Stop, void()); |
| 22 | MOCK_METHOD2(AddRoute, bool(int interface_index, |
| 23 | const RoutingTableEntry &entry)); |
| 24 | MOCK_METHOD3(GetDefaultRoute, bool(int interface_index, |
| 25 | IPAddress::Family family, |
| 26 | RoutingTableEntry *entry)); |
| 27 | MOCK_METHOD3(SetDefaultRoute, bool(int interface_index, |
| 28 | const IPConfigRefPtr &ipconfig, |
| 29 | uint32 metric)); |
Paul Stewart | 3f68bb1 | 2012-03-15 13:33:10 -0700 | [diff] [blame] | 30 | MOCK_METHOD3(ConfigureRoutes, bool(int interface_index, |
| 31 | const IPConfigRefPtr &ipconfig, |
| 32 | uint32 metric)); |
Thieu Le | fb46caf | 2012-03-08 11:57:15 -0800 | [diff] [blame] | 33 | MOCK_METHOD1(FlushRoutes, void(int interface_index)); |
Paul Stewart | c8f4bef | 2011-12-13 09:45:51 -0800 | [diff] [blame] | 34 | MOCK_METHOD0(FlushCache, bool()); |
Paul Stewart | dd60e45 | 2011-08-08 11:38:36 -0700 | [diff] [blame] | 35 | MOCK_METHOD1(ResetTable, void(int interface_index)); |
| 36 | MOCK_METHOD2(SetDefaultMetric, void(int interface_index, uint32 metric)); |
Paul Stewart | f748a36 | 2012-03-07 12:01:20 -0800 | [diff] [blame] | 37 | MOCK_METHOD2(RequestRouteToHost, bool(const IPAddress &addresss, |
| 38 | int interface_index)); |
Darin Petkov | eac68e6 | 2011-08-26 16:24:51 -0700 | [diff] [blame] | 39 | |
| 40 | private: |
| 41 | DISALLOW_COPY_AND_ASSIGN(MockRoutingTable); |
Paul Stewart | dd60e45 | 2011-08-08 11:38:36 -0700 | [diff] [blame] | 42 | }; |
| 43 | |
| 44 | } // namespace shill |
| 45 | |
| 46 | #endif // SHILL_MOCK_ROUTING_TABLE_H_ |