Darin Petkov | 1023a60 | 2010-08-30 13:47:51 -0700 | [diff] [blame] | 1 | // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
Alex Deymo | 560ae1d | 2014-10-28 02:17:54 -0700 | [diff] [blame] | 5 | #ifndef UPDATE_ENGINE_MOCK_UPDATE_ATTEMPTER_H_ |
| 6 | #define UPDATE_ENGINE_MOCK_UPDATE_ATTEMPTER_H_ |
Darin Petkov | 1023a60 | 2010-08-30 13:47:51 -0700 | [diff] [blame] | 7 | |
Alex Vakulenko | d2779df | 2014-06-16 13:19:00 -0700 | [diff] [blame] | 8 | #include <string> |
| 9 | |
Darin Petkov | 1023a60 | 2010-08-30 13:47:51 -0700 | [diff] [blame] | 10 | #include "update_engine/update_attempter.h" |
| 11 | |
Gilad Arnold | 76b2b48 | 2014-04-01 13:32:43 -0700 | [diff] [blame] | 12 | #include <gmock/gmock.h> |
| 13 | |
Darin Petkov | 1023a60 | 2010-08-30 13:47:51 -0700 | [diff] [blame] | 14 | namespace chromeos_update_engine { |
| 15 | |
Alex Deymo | 560ae1d | 2014-10-28 02:17:54 -0700 | [diff] [blame] | 16 | class MockUpdateAttempter : public UpdateAttempter { |
Darin Petkov | 1023a60 | 2010-08-30 13:47:51 -0700 | [diff] [blame] | 17 | public: |
Gilad Arnold | 76b2b48 | 2014-04-01 13:32:43 -0700 | [diff] [blame] | 18 | using UpdateAttempter::UpdateAttempter; |
Darin Petkov | 1023a60 | 2010-08-30 13:47:51 -0700 | [diff] [blame] | 19 | |
Gilad Arnold | ec7f916 | 2014-07-15 13:24:46 -0700 | [diff] [blame] | 20 | MOCK_METHOD6(Update, void(const std::string& app_version, |
Andrew de los Reyes | 4516810 | 2010-11-22 11:13:50 -0800 | [diff] [blame] | 21 | const std::string& omaha_url, |
Gilad Arnold | ec7f916 | 2014-07-15 13:24:46 -0700 | [diff] [blame] | 22 | const std::string& target_channel, |
| 23 | const std::string& target_version_prefix, |
Andrew de los Reyes | fb2f461 | 2011-06-09 18:21:49 -0700 | [diff] [blame] | 24 | bool obey_proxies, |
Nam T. Nguyen | 7d623eb | 2014-05-13 16:06:28 -0700 | [diff] [blame] | 25 | bool interactive)); |
Gilad Arnold | 76b2b48 | 2014-04-01 13:32:43 -0700 | [diff] [blame] | 26 | |
| 27 | MOCK_METHOD5(GetStatus, bool(int64_t* last_checked_time, |
| 28 | double* progress, |
| 29 | std::string* current_operation, |
| 30 | std::string* new_version, |
| 31 | int64_t* new_size)); |
| 32 | |
| 33 | MOCK_METHOD1(GetBootTimeAtUpdate, bool(base::Time* out_boot_time)); |
Gilad Arnold | a6dab94 | 2014-04-25 11:46:03 -0700 | [diff] [blame] | 34 | |
Alex Deymo | 560ae1d | 2014-10-28 02:17:54 -0700 | [diff] [blame] | 35 | MOCK_METHOD0(ResetStatus, bool(void)); |
| 36 | |
| 37 | MOCK_METHOD3(CheckForUpdate, void(const std::string& app_version, |
| 38 | const std::string& omaha_url, |
| 39 | bool is_interactive)); |
| 40 | |
| 41 | MOCK_METHOD0(RefreshDevicePolicy, void(void)); |
| 42 | |
Gilad Arnold | a6dab94 | 2014-04-25 11:46:03 -0700 | [diff] [blame] | 43 | MOCK_CONST_METHOD0(consecutive_failed_update_checks, unsigned int(void)); |
Gilad Arnold | a0258a5 | 2014-07-10 16:21:19 -0700 | [diff] [blame] | 44 | |
| 45 | MOCK_CONST_METHOD0(server_dictated_poll_interval, unsigned int(void)); |
Darin Petkov | 1023a60 | 2010-08-30 13:47:51 -0700 | [diff] [blame] | 46 | }; |
| 47 | |
| 48 | } // namespace chromeos_update_engine |
| 49 | |
Alex Deymo | 560ae1d | 2014-10-28 02:17:54 -0700 | [diff] [blame] | 50 | #endif // UPDATE_ENGINE_MOCK_UPDATE_ATTEMPTER_H_ |