Darin Petkov | a9b1fed | 2012-02-29 11:49:05 +0100 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium OS Authors. All rights reserved. |
Chris Masone | d7732e4 | 2011-05-20 11:08:56 -0700 | [diff] [blame] | 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_CONTROL_ |
| 6 | #define SHILL_MOCK_CONTROL_ |
| 7 | |
Darin Petkov | e0a312e | 2011-07-20 13:45:28 -0700 | [diff] [blame] | 8 | #include <base/basictypes.h> |
Chris Masone | 95207da | 2011-06-29 16:50:49 -0700 | [diff] [blame] | 9 | |
Chris Masone | d7732e4 | 2011-05-20 11:08:56 -0700 | [diff] [blame] | 10 | #include "shill/control_interface.h" |
| 11 | |
| 12 | namespace shill { |
Chris Masone | 95207da | 2011-06-29 16:50:49 -0700 | [diff] [blame] | 13 | // An implementation of the Shill RPC-channel-interface-factory interface that |
| 14 | // returns mocks. |
Chris Masone | d7732e4 | 2011-05-20 11:08:56 -0700 | [diff] [blame] | 15 | class MockControl : public ControlInterface { |
| 16 | public: |
Chris Masone | 95207da | 2011-06-29 16:50:49 -0700 | [diff] [blame] | 17 | MockControl(); |
| 18 | virtual ~MockControl(); |
| 19 | |
| 20 | // Each of these can be called once. Ownership of the appropriate |
| 21 | // interface pointer is given up upon call. |
Chris Masone | c6c6c13 | 2011-06-30 11:29:52 -0700 | [diff] [blame] | 22 | virtual DeviceAdaptorInterface *CreateDeviceAdaptor(Device *device); |
| 23 | virtual IPConfigAdaptorInterface *CreateIPConfigAdaptor(IPConfig *config); |
| 24 | virtual ManagerAdaptorInterface *CreateManagerAdaptor(Manager *manager); |
| 25 | virtual ProfileAdaptorInterface *CreateProfileAdaptor(Profile *profile); |
Darin Petkov | a9b1fed | 2012-02-29 11:49:05 +0100 | [diff] [blame] | 26 | virtual RPCTaskAdaptorInterface *CreateRPCTaskAdaptor(RPCTask *task); |
Chris Masone | c6c6c13 | 2011-06-30 11:29:52 -0700 | [diff] [blame] | 27 | virtual ServiceAdaptorInterface *CreateServiceAdaptor(Service *service); |
Chris Masone | 95207da | 2011-06-29 16:50:49 -0700 | [diff] [blame] | 28 | |
| 29 | private: |
| 30 | DISALLOW_COPY_AND_ASSIGN(MockControl); |
Chris Masone | d7732e4 | 2011-05-20 11:08:56 -0700 | [diff] [blame] | 31 | }; |
| 32 | |
| 33 | } // namespace shill |
| 34 | |
| 35 | #endif // SHILL_MOCK_CONTROL_ |