1 // 2 // Copyright (C) 2010 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 UPDATE_ENGINE_CROS_MOCK_UPDATE_ATTEMPTER_H_ 18 #define UPDATE_ENGINE_CROS_MOCK_UPDATE_ATTEMPTER_H_ 19 20 #include <string> 21 #include <vector> 22 23 #include "update_engine/cros/update_attempter.h" 24 25 #include <gmock/gmock.h> 26 27 namespace chromeos_update_engine { 28 29 class MockUpdateAttempter : public UpdateAttempter { 30 public: 31 using UpdateAttempter::UpdateAttempter; 32 33 MOCK_METHOD(void, 34 Update, 35 (const chromeos_update_manager::UpdateCheckParams& params), 36 (override)); 37 38 MOCK_METHOD1(GetStatus, bool(update_engine::UpdateEngineStatus* out_status)); 39 40 MOCK_METHOD1(GetBootTimeAtUpdate, bool(base::Time* out_boot_time)); 41 42 MOCK_METHOD0(ResetStatus, bool(void)); 43 44 MOCK_CONST_METHOD0(GetCurrentUpdateAttemptFlags, UpdateAttemptFlags(void)); 45 46 MOCK_METHOD3(CheckForUpdate, 47 bool(const std::string& app_version, 48 const std::string& omaha_url, 49 UpdateAttemptFlags flags)); 50 51 MOCK_METHOD2(CheckForInstall, 52 bool(const std::vector<std::string>& dlc_ids, 53 const std::string& omaha_url)); 54 55 MOCK_METHOD2(SetDlcActiveValue, bool(bool, const std::string&)); 56 57 MOCK_CONST_METHOD0(GetExcluder, ExcluderInterface*(void)); 58 59 MOCK_METHOD0(RefreshDevicePolicy, void(void)); 60 61 MOCK_CONST_METHOD0(consecutive_failed_update_checks, unsigned int(void)); 62 63 MOCK_CONST_METHOD0(server_dictated_poll_interval, unsigned int(void)); 64 }; 65 66 } // namespace chromeos_update_engine 67 68 #endif // UPDATE_ENGINE_CROS_MOCK_UPDATE_ATTEMPTER_H_ 69