blob: 56a070c00b1a302499dee454aabca6e6ae506a23 [file] [log] [blame]
Chris Masoned7732e42011-05-20 11:08:56 -07001// 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
14namespace shill {
15
16// These are the functions that a Manager adaptor must support
17class ManagerMockAdaptor : public ManagerAdaptorInterface {
18 public:
Chris Masone95207da2011-06-29 16:50:49 -070019 static const char kRpcId[];
20
21 ManagerMockAdaptor();
22 virtual ~ManagerMockAdaptor();
23 virtual const std::string &GetRpcIdentifier();
24
Chris Masoned7732e42011-05-20 11:08:56 -070025 MOCK_METHOD0(UpdateRunning, void(void));
Chris Masoned0ceb8c2011-06-02 10:05:39 -070026 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 MOCK_METHOD1(EmitStateChanged, void(const std::string&));
Chris Masone95207da2011-06-29 16:50:49 -070032
33 private:
34 const std::string rpc_id;
Chris Masoned7732e42011-05-20 11:08:56 -070035};
36
37// These are the functions that a Service adaptor must support
38class ServiceMockAdaptor : public ServiceAdaptorInterface {
39 public:
Chris Masone95207da2011-06-29 16:50:49 -070040 static const char kRpcId[];
41
42 ServiceMockAdaptor();
43 virtual ~ServiceMockAdaptor();
44 virtual const std::string &GetRpcIdentifier();
45
Chris Masoned7732e42011-05-20 11:08:56 -070046 MOCK_METHOD0(UpdateConnected, void(void));
Chris Masoned0ceb8c2011-06-02 10:05:39 -070047 MOCK_METHOD2(EmitBoolChanged, void(const std::string&, bool));
48 MOCK_METHOD2(EmitUintChanged, void(const std::string&, uint32));
49 MOCK_METHOD2(EmitIntChanged, void(const std::string&, int));
50 MOCK_METHOD2(EmitStringChanged, void(const std::string&, const std::string&));
Chris Masone95207da2011-06-29 16:50:49 -070051
52 private:
53 const std::string rpc_id;
Chris Masoned7732e42011-05-20 11:08:56 -070054};
55
56// These are the functions that a Device adaptor must support
57class DeviceMockAdaptor : public DeviceAdaptorInterface {
58 public:
Chris Masone95207da2011-06-29 16:50:49 -070059 static const char kRpcId[];
60
61 DeviceMockAdaptor();
62 virtual ~DeviceMockAdaptor();
63 virtual const std::string &GetRpcIdentifier();
64
Chris Masoned7732e42011-05-20 11:08:56 -070065 MOCK_METHOD0(UpdateEnabled, void(void));
Chris Masoned0ceb8c2011-06-02 10:05:39 -070066 MOCK_METHOD2(EmitBoolChanged, void(const std::string&, bool));
67 MOCK_METHOD2(EmitUintChanged, void(const std::string&, uint32));
68 MOCK_METHOD2(EmitIntChanged, void(const std::string&, int));
69 MOCK_METHOD2(EmitStringChanged, void(const std::string&, const std::string&));
Chris Masone95207da2011-06-29 16:50:49 -070070
71 private:
72 const std::string rpc_id;
Chris Masoned7732e42011-05-20 11:08:56 -070073};
74
75} // namespace shill
76#endif // SHILL_MOCK_ADAPTORS_