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 | |
Ben Chan | c54afe5 | 2014-11-05 10:28:08 -0800 | [diff] [blame] | 5 | #ifndef SHILL_CELLULAR_MOCK_MODEM_H_ |
| 6 | #define SHILL_CELLULAR_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 | |
Ben Chan | c54afe5 | 2014-11-05 10:28:08 -0800 | [diff] [blame] | 12 | #include "shill/cellular/modem.h" |
David Rochberg | fa1d31d | 2012-03-20 10:38:07 -0400 | [diff] [blame] | 13 | |
| 14 | namespace shill { |
| 15 | |
| 16 | class MockModem : public Modem { |
| 17 | public: |
Paul Stewart | 2f6c789 | 2015-06-16 13:13:10 -0700 | [diff] [blame^] | 18 | MockModem(const std::string& owner, |
| 19 | const std::string& service, |
| 20 | const std::string& path, |
| 21 | ModemInfo* modem_info); |
Ben Chan | 5ea763b | 2014-08-13 11:07:54 -0700 | [diff] [blame] | 22 | ~MockModem() override; |
David Rochberg | fa1d31d | 2012-03-20 10:38:07 -0400 | [diff] [blame] | 23 | |
| 24 | // This class only mocks the pure virtual methods; if you need a |
| 25 | // more thorough mock, know that modem_unittest.cc depends on the |
| 26 | // incompleteness of this mock. |
Eric Shienbrood | 7fce52c | 2012-04-13 19:11:02 -0400 | [diff] [blame] | 27 | MOCK_METHOD1(SetModemStateFromProperties, |
Paul Stewart | 2f6c789 | 2015-06-16 13:13:10 -0700 | [diff] [blame^] | 28 | void(const DBusPropertiesMap& properties)); |
David Rochberg | fa1d31d | 2012-03-20 10:38:07 -0400 | [diff] [blame] | 29 | MOCK_CONST_METHOD2(GetLinkName, |
Paul Stewart | 2f6c789 | 2015-06-16 13:13:10 -0700 | [diff] [blame^] | 30 | bool(const DBusPropertiesMap& modem_properties, |
| 31 | std::string* name)); |
Jason Glasgow | 4c0724a | 2012-04-17 15:47:40 -0400 | [diff] [blame] | 32 | MOCK_CONST_METHOD0(GetModemInterface, |
| 33 | std::string(void)); |
Paul Stewart | 2f6c789 | 2015-06-16 13:13:10 -0700 | [diff] [blame^] | 34 | MOCK_METHOD3(ConstructCellular, Cellular*( |
| 35 | const std::string& link_name, |
| 36 | const std::string& device_name, |
David Rochberg | fa1d31d | 2012-03-20 10:38:07 -0400 | [diff] [blame] | 37 | int ifindex)); |
| 38 | }; |
| 39 | typedef ::testing::StrictMock<MockModem> StrictModem; |
| 40 | |
| 41 | } // namespace shill |
| 42 | |
Ben Chan | c54afe5 | 2014-11-05 10:28:08 -0800 | [diff] [blame] | 43 | #endif // SHILL_CELLULAR_MOCK_MODEM_H_ |