blob: beda130dc00a1db56a9d0e8f92519530f9558584 [file] [log] [blame]
Darin Petkova9b1fed2012-02-29 11:49:05 +01001// Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
Chris Masoned7732e42011-05-20 11:08:56 -07002// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
Ben Chanc45688b2014-07-02 23:50:45 -07005#ifndef SHILL_MOCK_CONTROL_H_
6#define SHILL_MOCK_CONTROL_H_
Chris Masoned7732e42011-05-20 11:08:56 -07007
Ben Chancc67c522014-09-03 07:19:18 -07008#include <base/macros.h>
Chris Masone95207da2011-06-29 16:50:49 -07009
Chris Masoned7732e42011-05-20 11:08:56 -070010#include "shill/control_interface.h"
11
12namespace shill {
Chris Masone95207da2011-06-29 16:50:49 -070013// An implementation of the Shill RPC-channel-interface-factory interface that
14// returns mocks.
Chris Masoned7732e42011-05-20 11:08:56 -070015class MockControl : public ControlInterface {
16 public:
Chris Masone95207da2011-06-29 16:50:49 -070017 MockControl();
Ben Chan5ea763b2014-08-13 11:07:54 -070018 ~MockControl() override;
Chris Masone95207da2011-06-29 16:50:49 -070019
20 // Each of these can be called once. Ownership of the appropriate
21 // interface pointer is given up upon call.
Paul Stewart1e006c62015-06-16 12:29:06 -070022 DeviceAdaptorInterface* CreateDeviceAdaptor(Device* device) override;
23 IPConfigAdaptorInterface* CreateIPConfigAdaptor(IPConfig* config) override;
24 ManagerAdaptorInterface* CreateManagerAdaptor(Manager* manager) override;
25 ProfileAdaptorInterface* CreateProfileAdaptor(Profile* profile) override;
26 RPCTaskAdaptorInterface* CreateRPCTaskAdaptor(RPCTask* task) override;
27 ServiceAdaptorInterface* CreateServiceAdaptor(Service* service) override;
Prabhu Kaliamoorthi127b3412014-10-16 13:00:25 +020028#ifndef DISABLE_VPN
Paul Stewart1e006c62015-06-16 12:29:06 -070029 ThirdPartyVpnAdaptorInterface* CreateThirdPartyVpnAdaptor(
30 ThirdPartyVpnDriver* driver) override;
Prabhu Kaliamoorthi127b3412014-10-16 13:00:25 +020031#endif
Chris Masone95207da2011-06-29 16:50:49 -070032
33 private:
34 DISALLOW_COPY_AND_ASSIGN(MockControl);
Chris Masoned7732e42011-05-20 11:08:56 -070035};
36
37} // namespace shill
38
Ben Chanc45688b2014-07-02 23:50:45 -070039#endif // SHILL_MOCK_CONTROL_H_