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_ETHERNET_MOCK_ETHERNET_H_ 18 #define SHILL_ETHERNET_MOCK_ETHERNET_H_ 19 20 #include <string> 21 22 #include <gmock/gmock.h> 23 24 #include "shill/ethernet/ethernet.h" 25 #include "shill/refptr_types.h" 26 27 namespace shill { 28 29 class ControlInterface; 30 class Error; 31 class EventDispatcher; 32 33 class MockEthernet : public Ethernet { 34 public: 35 MockEthernet(ControlInterface* control_interface, 36 EventDispatcher* dispatcher, 37 Metrics* metrics, 38 Manager* manager, 39 const std::string& link_name, 40 const std::string& address, 41 int interface_index); 42 ~MockEthernet() override; 43 44 MOCK_METHOD2(Start, void(Error* error, 45 const EnabledStateChangedCallback& callback)); 46 MOCK_METHOD2(Stop, void(Error* error, 47 const EnabledStateChangedCallback& callback)); 48 MOCK_METHOD1(ConnectTo, void(EthernetService* service)); 49 MOCK_METHOD1(DisconnectFrom, void(EthernetService* service)); 50 MOCK_CONST_METHOD0(IsConnectedViaTether, bool()); 51 MOCK_CONST_METHOD0(link_up, bool()); 52 53 private: 54 DISALLOW_COPY_AND_ASSIGN(MockEthernet); 55 }; 56 57 } // namespace shill 58 59 #endif // SHILL_ETHERNET_MOCK_ETHERNET_H_ 60