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_CELLULAR_MOCK_CELLULAR_SERVICE_H_ 18 #define SHILL_CELLULAR_MOCK_CELLULAR_SERVICE_H_ 19 20 #include <string> 21 22 #include <gmock/gmock.h> 23 24 #include "shill/cellular/cellular_service.h" 25 26 namespace shill { 27 28 class MockCellularService : public CellularService { 29 public: 30 MockCellularService(ModemInfo* modem_info, 31 const CellularRefPtr& device); 32 ~MockCellularService() override; 33 34 MOCK_METHOD0(AutoConnect, void()); 35 MOCK_METHOD1(SetLastGoodApn, void(const Stringmap& apn_info)); 36 MOCK_METHOD0(ClearLastGoodApn, void()); 37 MOCK_METHOD1(SetActivationState, void(const std::string& state)); 38 MOCK_METHOD2(Connect, void(Error* error, const char* reason)); 39 MOCK_METHOD2(Disconnect, void(Error* error, const char* reason)); 40 MOCK_METHOD1(SetState, void(ConnectState state)); 41 MOCK_METHOD1(SetFailure, void(ConnectFailure failure)); 42 MOCK_METHOD1(SetFailureSilent, void(ConnectFailure failure)); 43 MOCK_CONST_METHOD0(state, ConnectState()); 44 MOCK_CONST_METHOD0(explicitly_disconnected, bool()); 45 MOCK_CONST_METHOD0(activation_state, const std::string&()); 46 MOCK_CONST_METHOD0(resume_start_time, const base::Time&()); 47 48 private: 49 std::string default_activation_state_; 50 51 DISALLOW_COPY_AND_ASSIGN(MockCellularService); 52 }; 53 54 } // namespace shill 55 56 #endif // SHILL_CELLULAR_MOCK_CELLULAR_SERVICE_H_ 57