Alex Deymo | aea4c1c | 2015-08-19 20:24:43 -0700 | [diff] [blame] | 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 | // |
Darin Petkov | 1023a60 | 2010-08-30 13:47:51 -0700 | [diff] [blame] | 16 | |
Alex Deymo | 560ae1d | 2014-10-28 02:17:54 -0700 | [diff] [blame] | 17 | #ifndef UPDATE_ENGINE_MOCK_UPDATE_ATTEMPTER_H_ |
| 18 | #define UPDATE_ENGINE_MOCK_UPDATE_ATTEMPTER_H_ |
Darin Petkov | 1023a60 | 2010-08-30 13:47:51 -0700 | [diff] [blame] | 19 | |
Alex Vakulenko | d2779df | 2014-06-16 13:19:00 -0700 | [diff] [blame] | 20 | #include <string> |
Xiaochu Liu | 88d9038 | 2018-08-29 16:09:11 -0700 | [diff] [blame] | 21 | #include <vector> |
Alex Vakulenko | d2779df | 2014-06-16 13:19:00 -0700 | [diff] [blame] | 22 | |
Darin Petkov | 1023a60 | 2010-08-30 13:47:51 -0700 | [diff] [blame] | 23 | #include "update_engine/update_attempter.h" |
| 24 | |
Gilad Arnold | 76b2b48 | 2014-04-01 13:32:43 -0700 | [diff] [blame] | 25 | #include <gmock/gmock.h> |
| 26 | |
Darin Petkov | 1023a60 | 2010-08-30 13:47:51 -0700 | [diff] [blame] | 27 | namespace chromeos_update_engine { |
| 28 | |
Alex Deymo | 560ae1d | 2014-10-28 02:17:54 -0700 | [diff] [blame] | 29 | class MockUpdateAttempter : public UpdateAttempter { |
Darin Petkov | 1023a60 | 2010-08-30 13:47:51 -0700 | [diff] [blame] | 30 | public: |
Gilad Arnold | 76b2b48 | 2014-04-01 13:32:43 -0700 | [diff] [blame] | 31 | using UpdateAttempter::UpdateAttempter; |
Darin Petkov | 1023a60 | 2010-08-30 13:47:51 -0700 | [diff] [blame] | 32 | |
Zentaro Kavanagh | 28def4f | 2019-01-15 17:15:01 -0800 | [diff] [blame] | 33 | MOCK_METHOD9(Update, |
Marton Hunyady | ba51c3f | 2018-04-25 15:18:10 +0200 | [diff] [blame] | 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, |
Zentaro Kavanagh | 28def4f | 2019-01-15 17:15:01 -0800 | [diff] [blame] | 39 | bool rollback_data_save_requested, |
Zentaro Kavanagh | 0ef9a2f | 2018-07-02 12:05:07 -0700 | [diff] [blame] | 40 | int rollback_allowed_milestones, |
Marton Hunyady | ba51c3f | 2018-04-25 15:18:10 +0200 | [diff] [blame] | 41 | bool obey_proxies, |
| 42 | bool interactive)); |
Gilad Arnold | 76b2b48 | 2014-04-01 13:32:43 -0700 | [diff] [blame] | 43 | |
Aaron Wood | 7f92e2b | 2017-08-28 14:51:21 -0700 | [diff] [blame] | 44 | MOCK_METHOD1(GetStatus, bool(update_engine::UpdateEngineStatus* out_status)); |
Gilad Arnold | 76b2b48 | 2014-04-01 13:32:43 -0700 | [diff] [blame] | 45 | |
| 46 | MOCK_METHOD1(GetBootTimeAtUpdate, bool(base::Time* out_boot_time)); |
Gilad Arnold | a6dab94 | 2014-04-25 11:46:03 -0700 | [diff] [blame] | 47 | |
Alex Deymo | 560ae1d | 2014-10-28 02:17:54 -0700 | [diff] [blame] | 48 | MOCK_METHOD0(ResetStatus, bool(void)); |
| 49 | |
Sen Jiang | daeaa43 | 2018-10-09 18:18:45 -0700 | [diff] [blame] | 50 | MOCK_CONST_METHOD0(GetCurrentUpdateAttemptFlags, UpdateAttemptFlags(void)); |
Aaron Wood | bf5a252 | 2017-10-04 10:58:36 -0700 | [diff] [blame] | 51 | |
Aaron Wood | 081c023 | 2017-10-19 17:14:58 -0700 | [diff] [blame] | 52 | MOCK_METHOD3(CheckForUpdate, |
| 53 | bool(const std::string& app_version, |
| 54 | const std::string& omaha_url, |
| 55 | UpdateAttemptFlags flags)); |
Alex Deymo | 560ae1d | 2014-10-28 02:17:54 -0700 | [diff] [blame] | 56 | |
Xiaochu Liu | 88d9038 | 2018-08-29 16:09:11 -0700 | [diff] [blame] | 57 | MOCK_METHOD2(CheckForInstall, |
Amin Hassani | 2b68e6b | 2020-04-17 10:49:12 -0700 | [diff] [blame] | 58 | bool(const std::vector<std::string>& dlc_ids, |
Xiaochu Liu | 88d9038 | 2018-08-29 16:09:11 -0700 | [diff] [blame] | 59 | const std::string& omaha_url)); |
| 60 | |
Andrew | a8d7df3 | 2020-03-15 20:10:01 -0700 | [diff] [blame] | 61 | MOCK_METHOD2(SetDlcActiveValue, bool(bool, const std::string&)); |
| 62 | |
Jae Hoon Kim | 5e8e30b | 2020-05-06 14:59:06 -0700 | [diff] [blame] | 63 | MOCK_CONST_METHOD0(GetExcluder, ExcluderInterface*(void)); |
| 64 | |
Alex Deymo | 560ae1d | 2014-10-28 02:17:54 -0700 | [diff] [blame] | 65 | MOCK_METHOD0(RefreshDevicePolicy, void(void)); |
| 66 | |
Gilad Arnold | a6dab94 | 2014-04-25 11:46:03 -0700 | [diff] [blame] | 67 | MOCK_CONST_METHOD0(consecutive_failed_update_checks, unsigned int(void)); |
Gilad Arnold | a0258a5 | 2014-07-10 16:21:19 -0700 | [diff] [blame] | 68 | |
| 69 | MOCK_CONST_METHOD0(server_dictated_poll_interval, unsigned int(void)); |
Darin Petkov | 1023a60 | 2010-08-30 13:47:51 -0700 | [diff] [blame] | 70 | }; |
| 71 | |
| 72 | } // namespace chromeos_update_engine |
| 73 | |
Alex Deymo | 560ae1d | 2014-10-28 02:17:54 -0700 | [diff] [blame] | 74 | #endif // UPDATE_ENGINE_MOCK_UPDATE_ATTEMPTER_H_ |