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#ifndef SHILL_DHCP_MOCK_DHCP_PROVIDER_H_ 18#define SHILL_DHCP_MOCK_DHCP_PROVIDER_H_ 19 20#include <string> 21 22#include <base/macros.h> 23#include <gmock/gmock.h> 24 25#include "shill/dhcp/dhcp_config.h" 26#include "shill/dhcp/dhcp_provider.h" 27#include "shill/dhcp_properties.h" 28#include "shill/refptr_types.h" 29 30namespace shill { 31 32class MockDHCPProvider : public DHCPProvider { 33 public: 34 MockDHCPProvider(); 35 ~MockDHCPProvider() override; 36 37 MOCK_METHOD3(Init, 38 void(ControlInterface*, EventDispatcher*, Metrics*)); 39 MOCK_METHOD4(CreateIPv4Config, 40 DHCPConfigRefPtr(const std::string& device_name, 41 const std::string& storage_identifier, 42 bool arp_gateway, 43 const DhcpProperties& dhcp_props)); 44 MOCK_METHOD2(CreateIPv6Config, 45 DHCPConfigRefPtr(const std::string& device_name, 46 const std::string& storage_identifier)); 47 MOCK_METHOD2(BindPID, void(int pid, const DHCPConfigRefPtr& config)); 48 MOCK_METHOD1(UnbindPID, void(int pid)); 49 50 private: 51 DISALLOW_COPY_AND_ASSIGN(MockDHCPProvider); 52}; 53 54} // namespace shill 55 56#endif // SHILL_DHCP_MOCK_DHCP_PROVIDER_H_ 57