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_MOCK_UPDATE_ATTEMPTER_H_ 18 #define UPDATE_ENGINE_MOCK_UPDATE_ATTEMPTER_H_ 19 20 #include <string> 21 #include <vector> 22 23 #include "update_engine/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_METHOD7(Update, 34 void(const std::string& app_version, 35 const std::string& omaha_url, 36 const std::string& target_channel, 37 const std::string& target_version_prefix, 38 bool rollback_allowed, 39 bool obey_proxies, 40 bool interactive)); 41 42 MOCK_METHOD1(GetStatus, bool(update_engine::UpdateEngineStatus* out_status)); 43 44 MOCK_METHOD1(GetBootTimeAtUpdate, bool(base::Time* out_boot_time)); 45 46 MOCK_METHOD0(ResetStatus, bool(void)); 47 48 MOCK_CONST_METHOD0(GetCurrentUpdateAttemptFlags, UpdateAttemptFlags(void)); 49 50 MOCK_METHOD3(CheckForUpdate, 51 bool(const std::string& app_version, 52 const std::string& omaha_url, 53 UpdateAttemptFlags flags)); 54 55 MOCK_METHOD2(CheckForInstall, 56 bool(const std::vector<std::string>& dlc_module_ids, 57 const std::string& omaha_url)); 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_MOCK_UPDATE_ATTEMPTER_H_ 69