Chris Masone | d7732e4 | 2011-05-20 11:08:56 -0700 | [diff] [blame] | 1 | // Copyright (c) 2011 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_ADAPTORS_ |
| 6 | #define SHILL_MOCK_ADAPTORS_ |
| 7 | |
| 8 | #include <string> |
| 9 | |
| 10 | #include <gmock/gmock.h> |
| 11 | |
| 12 | #include "shill/adaptor_interfaces.h" |
| 13 | |
| 14 | namespace shill { |
| 15 | |
Chris Masone | c6c6c13 | 2011-06-30 11:29:52 -0700 | [diff] [blame^] | 16 | // These are the functions that a Device adaptor must support |
| 17 | class DeviceMockAdaptor : public DeviceAdaptorInterface { |
| 18 | public: |
| 19 | static const char kRpcId[]; |
| 20 | |
| 21 | DeviceMockAdaptor(); |
| 22 | virtual ~DeviceMockAdaptor(); |
| 23 | virtual const std::string &GetRpcIdentifier(); |
| 24 | |
| 25 | MOCK_METHOD0(UpdateEnabled, void(void)); |
| 26 | MOCK_METHOD2(EmitBoolChanged, void(const std::string&, bool)); |
| 27 | MOCK_METHOD2(EmitUintChanged, void(const std::string&, uint32)); |
| 28 | MOCK_METHOD2(EmitIntChanged, void(const std::string&, int)); |
| 29 | MOCK_METHOD2(EmitStringChanged, void(const std::string&, const std::string&)); |
| 30 | |
| 31 | private: |
| 32 | const std::string rpc_id; |
| 33 | }; |
| 34 | |
| 35 | // These are the functions that a IPConfig adaptor must support |
| 36 | class IPConfigMockAdaptor : public IPConfigAdaptorInterface { |
| 37 | public: |
| 38 | static const char kRpcId[]; |
| 39 | |
| 40 | IPConfigMockAdaptor(); |
| 41 | virtual ~IPConfigMockAdaptor(); |
| 42 | virtual const std::string &GetRpcIdentifier(); |
| 43 | |
| 44 | MOCK_METHOD2(EmitBoolChanged, void(const std::string&, bool)); |
| 45 | MOCK_METHOD2(EmitUintChanged, void(const std::string&, uint32)); |
| 46 | MOCK_METHOD2(EmitIntChanged, void(const std::string&, int)); |
| 47 | MOCK_METHOD2(EmitStringChanged, void(const std::string&, const std::string&)); |
| 48 | |
| 49 | private: |
| 50 | const std::string rpc_id; |
| 51 | }; |
| 52 | |
Chris Masone | d7732e4 | 2011-05-20 11:08:56 -0700 | [diff] [blame] | 53 | // These are the functions that a Manager adaptor must support |
| 54 | class ManagerMockAdaptor : public ManagerAdaptorInterface { |
| 55 | public: |
Chris Masone | 95207da | 2011-06-29 16:50:49 -0700 | [diff] [blame] | 56 | static const char kRpcId[]; |
| 57 | |
| 58 | ManagerMockAdaptor(); |
| 59 | virtual ~ManagerMockAdaptor(); |
| 60 | virtual const std::string &GetRpcIdentifier(); |
| 61 | |
Chris Masone | d7732e4 | 2011-05-20 11:08:56 -0700 | [diff] [blame] | 62 | MOCK_METHOD0(UpdateRunning, void(void)); |
Chris Masone | d0ceb8c | 2011-06-02 10:05:39 -0700 | [diff] [blame] | 63 | MOCK_METHOD2(EmitBoolChanged, void(const std::string&, bool)); |
| 64 | MOCK_METHOD2(EmitUintChanged, void(const std::string&, uint32)); |
| 65 | MOCK_METHOD2(EmitIntChanged, void(const std::string&, int)); |
| 66 | MOCK_METHOD2(EmitStringChanged, void(const std::string&, const std::string&)); |
| 67 | |
| 68 | MOCK_METHOD1(EmitStateChanged, void(const std::string&)); |
Chris Masone | 95207da | 2011-06-29 16:50:49 -0700 | [diff] [blame] | 69 | |
| 70 | private: |
| 71 | const std::string rpc_id; |
Chris Masone | d7732e4 | 2011-05-20 11:08:56 -0700 | [diff] [blame] | 72 | }; |
| 73 | |
Chris Masone | c6c6c13 | 2011-06-30 11:29:52 -0700 | [diff] [blame^] | 74 | // These are the functions that a Profile adaptor must support |
| 75 | class ProfileMockAdaptor : public ProfileAdaptorInterface { |
| 76 | public: |
| 77 | static const char kRpcId[]; |
| 78 | |
| 79 | ProfileMockAdaptor(); |
| 80 | virtual ~ProfileMockAdaptor(); |
| 81 | virtual const std::string &GetRpcIdentifier(); |
| 82 | |
| 83 | MOCK_METHOD2(EmitBoolChanged, void(const std::string&, bool)); |
| 84 | MOCK_METHOD2(EmitUintChanged, void(const std::string&, uint32)); |
| 85 | MOCK_METHOD2(EmitIntChanged, void(const std::string&, int)); |
| 86 | MOCK_METHOD2(EmitStringChanged, void(const std::string&, const std::string&)); |
| 87 | |
| 88 | private: |
| 89 | const std::string rpc_id; |
| 90 | }; |
| 91 | |
Chris Masone | d7732e4 | 2011-05-20 11:08:56 -0700 | [diff] [blame] | 92 | // These are the functions that a Service adaptor must support |
| 93 | class ServiceMockAdaptor : public ServiceAdaptorInterface { |
| 94 | public: |
Chris Masone | 95207da | 2011-06-29 16:50:49 -0700 | [diff] [blame] | 95 | static const char kRpcId[]; |
| 96 | |
| 97 | ServiceMockAdaptor(); |
| 98 | virtual ~ServiceMockAdaptor(); |
| 99 | virtual const std::string &GetRpcIdentifier(); |
| 100 | |
Chris Masone | d7732e4 | 2011-05-20 11:08:56 -0700 | [diff] [blame] | 101 | MOCK_METHOD0(UpdateConnected, void(void)); |
Chris Masone | d0ceb8c | 2011-06-02 10:05:39 -0700 | [diff] [blame] | 102 | MOCK_METHOD2(EmitBoolChanged, void(const std::string&, bool)); |
| 103 | MOCK_METHOD2(EmitUintChanged, void(const std::string&, uint32)); |
| 104 | MOCK_METHOD2(EmitIntChanged, void(const std::string&, int)); |
| 105 | MOCK_METHOD2(EmitStringChanged, void(const std::string&, const std::string&)); |
Chris Masone | 95207da | 2011-06-29 16:50:49 -0700 | [diff] [blame] | 106 | |
| 107 | private: |
| 108 | const std::string rpc_id; |
Chris Masone | d7732e4 | 2011-05-20 11:08:56 -0700 | [diff] [blame] | 109 | }; |
| 110 | |
Chris Masone | d7732e4 | 2011-05-20 11:08:56 -0700 | [diff] [blame] | 111 | } // namespace shill |
| 112 | #endif // SHILL_MOCK_ADAPTORS_ |