blob: 32a2a77ff74fe86fc6b311dbd563652a51269713 [file] [log] [blame]
David Rochbergfa1d31d2012-03-20 10:38:07 -04001// 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 Chanc54afe52014-11-05 10:28:08 -08005#ifndef SHILL_CELLULAR_MOCK_MODEM_H_
6#define SHILL_CELLULAR_MOCK_MODEM_H_
David Rochbergfa1d31d2012-03-20 10:38:07 -04007
8#include <string>
9
10#include <gmock/gmock.h>
11
Ben Chanc54afe52014-11-05 10:28:08 -080012#include "shill/cellular/modem.h"
David Rochbergfa1d31d2012-03-20 10:38:07 -040013
14namespace shill {
15
16class MockModem : public Modem {
17 public:
Paul Stewart2f6c7892015-06-16 13:13:10 -070018 MockModem(const std::string& owner,
19 const std::string& service,
20 const std::string& path,
21 ModemInfo* modem_info);
Ben Chan5ea763b2014-08-13 11:07:54 -070022 ~MockModem() override;
David Rochbergfa1d31d2012-03-20 10:38:07 -040023
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 Shienbrood7fce52c2012-04-13 19:11:02 -040027 MOCK_METHOD1(SetModemStateFromProperties,
Paul Stewart2f6c7892015-06-16 13:13:10 -070028 void(const DBusPropertiesMap& properties));
David Rochbergfa1d31d2012-03-20 10:38:07 -040029 MOCK_CONST_METHOD2(GetLinkName,
Paul Stewart2f6c7892015-06-16 13:13:10 -070030 bool(const DBusPropertiesMap& modem_properties,
31 std::string* name));
Jason Glasgow4c0724a2012-04-17 15:47:40 -040032 MOCK_CONST_METHOD0(GetModemInterface,
33 std::string(void));
Paul Stewart2f6c7892015-06-16 13:13:10 -070034 MOCK_METHOD3(ConstructCellular, Cellular*(
35 const std::string& link_name,
36 const std::string& device_name,
David Rochbergfa1d31d2012-03-20 10:38:07 -040037 int ifindex));
38};
39typedef ::testing::StrictMock<MockModem> StrictModem;
40
41} // namespace shill
42
Ben Chanc54afe52014-11-05 10:28:08 -080043#endif // SHILL_CELLULAR_MOCK_MODEM_H_