1 // 2 // Copyright (C) 2013 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_ETHERNET_MOCK_ETHERNET_SERVICE_H_ 18 #define SHILL_ETHERNET_MOCK_ETHERNET_SERVICE_H_ 19 20 #include <string> 21 22 #include <gmock/gmock.h> 23 24 #include "shill/ethernet/ethernet_service.h" 25 26 namespace shill { 27 28 class MockEthernetService : public EthernetService { 29 public: 30 MockEthernetService(ControlInterface* control_interface, Metrics* metrics, 31 base::WeakPtr<Ethernet> ethernet); 32 ~MockEthernetService() override; 33 34 MOCK_METHOD2(AddEAPCertification, bool(const std::string& name, 35 size_t depth)); 36 MOCK_METHOD0(ClearEAPCertification, void()); 37 MOCK_METHOD2(Configure, void(const KeyValueStore& args, Error* error)); 38 MOCK_METHOD2(Disconnect, void(Error* error, const char* reason)); 39 MOCK_METHOD3(DisconnectWithFailure, 40 void(ConnectFailure failure, Error* error, const char* reason)); 41 MOCK_CONST_METHOD1(GetDeviceRpcId, std::string(Error* error)); 42 MOCK_CONST_METHOD0(GetStorageIdentifier, std::string()); 43 MOCK_CONST_METHOD0(Is8021xConnectable, bool()); 44 MOCK_CONST_METHOD0(IsConnected, bool()); 45 MOCK_CONST_METHOD0(IsConnecting, bool()); 46 MOCK_CONST_METHOD0(IsRemembered, bool()); 47 MOCK_METHOD1(SetFailure, void(ConnectFailure failure)); 48 MOCK_METHOD1(SetFailureSilent, void(ConnectFailure failure)); 49 MOCK_METHOD1(SetState, void(ConnectState state)); 50 MOCK_METHOD0(OnVisibilityChanged, void()); 51 MOCK_CONST_METHOD0(technology, Technology::Identifier()); 52 53 private: 54 DISALLOW_COPY_AND_ASSIGN(MockEthernetService); 55 }; 56 57 } // namespace shill 58 59 #endif // SHILL_ETHERNET_MOCK_ETHERNET_SERVICE_H_ 60