David Rochberg | fa1d31d | 2012-03-20 10:38:07 -0400 | [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_MODEM_H_ |
Ben Chan | 62028b2 | 2012-11-05 11:20:02 -0800 | [diff] [blame] | 6 | #define SHILL_MOCK_MODEM_H_ |
David Rochberg | fa1d31d | 2012-03-20 10:38:07 -0400 | [diff] [blame] | 7 | |
| 8 | #include <string> |
| 9 | |
| 10 | #include <gmock/gmock.h> |
| 11 | |
| 12 | #include "shill/modem.h" |
| 13 | |
| 14 | namespace shill { |
| 15 | |
| 16 | class MockModem : public Modem { |
| 17 | public: |
| 18 | MockModem(const std::string &owner, |
Jason Glasgow | a585fc3 | 2012-06-06 11:04:09 -0400 | [diff] [blame] | 19 | const std::string &service, |
David Rochberg | fa1d31d | 2012-03-20 10:38:07 -0400 | [diff] [blame] | 20 | const std::string &path, |
| 21 | ControlInterface *control_interface, |
| 22 | EventDispatcher *dispatcher, |
| 23 | Metrics *metrics, |
| 24 | Manager *manager, |
Ben Chan | 62028b2 | 2012-11-05 11:20:02 -0800 | [diff] [blame] | 25 | CellularOperatorInfo *cellular_operator_info, |
David Rochberg | fa1d31d | 2012-03-20 10:38:07 -0400 | [diff] [blame] | 26 | mobile_provider_db *provider_db); |
| 27 | virtual ~MockModem(); |
| 28 | |
| 29 | // This class only mocks the pure virtual methods; if you need a |
| 30 | // more thorough mock, know that modem_unittest.cc depends on the |
| 31 | // incompleteness of this mock. |
Eric Shienbrood | 7fce52c | 2012-04-13 19:11:02 -0400 | [diff] [blame] | 32 | MOCK_METHOD1(SetModemStateFromProperties, |
| 33 | void(const DBusPropertiesMap &properties)); |
David Rochberg | fa1d31d | 2012-03-20 10:38:07 -0400 | [diff] [blame] | 34 | MOCK_CONST_METHOD2(GetLinkName, |
| 35 | bool(const DBusPropertiesMap &modem_properties, |
| 36 | std::string *name)); |
Jason Glasgow | 4c0724a | 2012-04-17 15:47:40 -0400 | [diff] [blame] | 37 | MOCK_CONST_METHOD0(GetModemInterface, |
| 38 | std::string(void)); |
David Rochberg | fa1d31d | 2012-03-20 10:38:07 -0400 | [diff] [blame] | 39 | MOCK_METHOD3(ConstructCellular, Cellular *( |
| 40 | const std::string &link_name, |
| 41 | const std::string &device_name, |
| 42 | int ifindex)); |
| 43 | }; |
| 44 | typedef ::testing::StrictMock<MockModem> StrictModem; |
| 45 | |
| 46 | } // namespace shill |
| 47 | |
| 48 | #endif // SHILL_MOCK_MODEM_H_ |