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_MOCK_PPP_DEVICE_H_ 18 #define SHILL_MOCK_PPP_DEVICE_H_ 19 20 #include <map> 21 #include <string> 22 23 #include <gmock/gmock.h> 24 25 #include "shill/ppp_device.h" 26 27 namespace shill { 28 29 class MockPPPDevice : public PPPDevice { 30 public: 31 MockPPPDevice(ControlInterface* control, 32 EventDispatcher* dispatcher, 33 Metrics* metrics, 34 Manager* manager, 35 const std::string& link_name, 36 int interface_index); 37 ~MockPPPDevice() override; 38 39 MOCK_METHOD2(Stop, 40 void(Error* error, const EnabledStateChangedCallback& callback)); 41 MOCK_METHOD1(UpdateIPConfig, void(const IPConfig::Properties& properties)); 42 MOCK_METHOD0(DropConnection, void()); 43 MOCK_METHOD1(SelectService, void(const ServiceRefPtr& service)); 44 MOCK_METHOD1(SetServiceState, void(Service::ConnectState)); 45 MOCK_METHOD1(SetServiceFailure, void(Service::ConnectFailure)); 46 MOCK_METHOD1(SetServiceFailureSilent, void(Service::ConnectFailure)); 47 MOCK_METHOD1(SetEnabled, void(bool)); 48 MOCK_METHOD2(UpdateIPConfigFromPPP, void( 49 const std::map<std::string, std::string>& config, 50 bool blackhole_ipv6)); 51 MOCK_METHOD3(UpdateIPConfigFromPPPWithMTU, void( 52 const std::map<std::string, std::string>& config, 53 bool blackhole_ipv6, 54 int32_t mtu)); 55 MOCK_METHOD0(AcquireIPv6Config, bool()); 56 57 private: 58 DISALLOW_COPY_AND_ASSIGN(MockPPPDevice); 59 }; 60 61 } // namespace shill 62 63 #endif // SHILL_MOCK_PPP_DEVICE_H_ 64