1 // 2 // Copyright (C) 2012 The Android Open Source Project 3 // 4 // Licensed under the Apache License, Version 2.0 (the "License"); 5 // you may not use this file except in compliance with the License. 6 // You may obtain a copy of the License at 7 // 8 // http://www.apache.org/licenses/LICENSE-2.0 9 // 10 // Unless required by applicable law or agreed to in writing, software 11 // distributed under the License is distributed on an "AS IS" BASIS, 12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 // See the License for the specific language governing permissions and 14 // limitations under the License. 15 // 16 17 #include "shill/nice_mock_control.h" 18 19 #include <gmock/gmock.h> 20 21 #include "shill/mock_adaptors.h" 22 23 using ::testing::NiceMock; 24 25 namespace shill { 26 NiceMockControl()27NiceMockControl::NiceMockControl() {} 28 ~NiceMockControl()29NiceMockControl::~NiceMockControl() {} 30 CreateDeviceAdaptor(Device *)31DeviceAdaptorInterface* NiceMockControl::CreateDeviceAdaptor( 32 Device* /*device*/) { 33 return new NiceMock<DeviceMockAdaptor>(); 34 } 35 CreateIPConfigAdaptor(IPConfig *)36IPConfigAdaptorInterface* NiceMockControl::CreateIPConfigAdaptor( 37 IPConfig* /*config*/) { 38 return new NiceMock<IPConfigMockAdaptor>(); 39 } 40 CreateManagerAdaptor(Manager *)41ManagerAdaptorInterface* NiceMockControl::CreateManagerAdaptor( 42 Manager* /*manager*/) { 43 return new NiceMock<ManagerMockAdaptor>(); 44 } 45 CreateProfileAdaptor(Profile *)46ProfileAdaptorInterface* NiceMockControl::CreateProfileAdaptor( 47 Profile* /*profile*/) { 48 return new NiceMock<ProfileMockAdaptor>(); 49 } 50 CreateRPCTaskAdaptor(RPCTask *)51RPCTaskAdaptorInterface* NiceMockControl::CreateRPCTaskAdaptor( 52 RPCTask* /*task*/) { 53 return new NiceMock<RPCTaskMockAdaptor>(); 54 } 55 CreateServiceAdaptor(Service *)56ServiceAdaptorInterface* NiceMockControl::CreateServiceAdaptor( 57 Service* /*service*/) { 58 return new NiceMock<ServiceMockAdaptor>(); 59 } 60 61 #ifndef DISABLE_VPN CreateThirdPartyVpnAdaptor(ThirdPartyVpnDriver *)62ThirdPartyVpnAdaptorInterface* NiceMockControl::CreateThirdPartyVpnAdaptor( 63 ThirdPartyVpnDriver* /*driver*/) { 64 return new NiceMock<ThirdPartyVpnMockAdaptor>(); 65 } 66 #endif 67 NullRPCIdentifier()68const std::string& NiceMockControl::NullRPCIdentifier() { 69 return null_identifier_; 70 } 71 72 } // namespace shill 73