blob: ad348028bc2c0fe8589702e3365414c3ac527ad0 [file] [log] [blame]
Alex Deymoaea4c1c2015-08-19 20:24:43 -07001//
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 Petkov1023a602010-08-30 13:47:51 -070016
Alex Deymo560ae1d2014-10-28 02:17:54 -070017#ifndef UPDATE_ENGINE_MOCK_UPDATE_ATTEMPTER_H_
18#define UPDATE_ENGINE_MOCK_UPDATE_ATTEMPTER_H_
Darin Petkov1023a602010-08-30 13:47:51 -070019
Alex Vakulenkod2779df2014-06-16 13:19:00 -070020#include <string>
Xiaochu Liu88d90382018-08-29 16:09:11 -070021#include <vector>
Alex Vakulenkod2779df2014-06-16 13:19:00 -070022
Darin Petkov1023a602010-08-30 13:47:51 -070023#include "update_engine/update_attempter.h"
24
Gilad Arnold76b2b482014-04-01 13:32:43 -070025#include <gmock/gmock.h>
26
Darin Petkov1023a602010-08-30 13:47:51 -070027namespace chromeos_update_engine {
28
Alex Deymo560ae1d2014-10-28 02:17:54 -070029class MockUpdateAttempter : public UpdateAttempter {
Darin Petkov1023a602010-08-30 13:47:51 -070030 public:
Gilad Arnold76b2b482014-04-01 13:32:43 -070031 using UpdateAttempter::UpdateAttempter;
Darin Petkov1023a602010-08-30 13:47:51 -070032
Zentaro Kavanagh28def4f2019-01-15 17:15:01 -080033 MOCK_METHOD9(Update,
Marton Hunyadyba51c3f2018-04-25 15:18:10 +020034 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 Kavanagh28def4f2019-01-15 17:15:01 -080039 bool rollback_data_save_requested,
Zentaro Kavanagh0ef9a2f2018-07-02 12:05:07 -070040 int rollback_allowed_milestones,
Marton Hunyadyba51c3f2018-04-25 15:18:10 +020041 bool obey_proxies,
42 bool interactive));
Gilad Arnold76b2b482014-04-01 13:32:43 -070043
Aaron Wood7f92e2b2017-08-28 14:51:21 -070044 MOCK_METHOD1(GetStatus, bool(update_engine::UpdateEngineStatus* out_status));
Gilad Arnold76b2b482014-04-01 13:32:43 -070045
46 MOCK_METHOD1(GetBootTimeAtUpdate, bool(base::Time* out_boot_time));
Gilad Arnolda6dab942014-04-25 11:46:03 -070047
Alex Deymo560ae1d2014-10-28 02:17:54 -070048 MOCK_METHOD0(ResetStatus, bool(void));
49
Sen Jiangdaeaa432018-10-09 18:18:45 -070050 MOCK_CONST_METHOD0(GetCurrentUpdateAttemptFlags, UpdateAttemptFlags(void));
Aaron Woodbf5a2522017-10-04 10:58:36 -070051
Aaron Wood081c0232017-10-19 17:14:58 -070052 MOCK_METHOD3(CheckForUpdate,
53 bool(const std::string& app_version,
54 const std::string& omaha_url,
55 UpdateAttemptFlags flags));
Alex Deymo560ae1d2014-10-28 02:17:54 -070056
Xiaochu Liu88d90382018-08-29 16:09:11 -070057 MOCK_METHOD2(CheckForInstall,
Amin Hassani2b68e6b2020-04-17 10:49:12 -070058 bool(const std::vector<std::string>& dlc_ids,
Xiaochu Liu88d90382018-08-29 16:09:11 -070059 const std::string& omaha_url));
60
Andrewa8d7df32020-03-15 20:10:01 -070061 MOCK_METHOD2(SetDlcActiveValue, bool(bool, const std::string&));
62
Jae Hoon Kim5e8e30b2020-05-06 14:59:06 -070063 MOCK_CONST_METHOD0(GetExcluder, ExcluderInterface*(void));
64
Alex Deymo560ae1d2014-10-28 02:17:54 -070065 MOCK_METHOD0(RefreshDevicePolicy, void(void));
66
Gilad Arnolda6dab942014-04-25 11:46:03 -070067 MOCK_CONST_METHOD0(consecutive_failed_update_checks, unsigned int(void));
Gilad Arnolda0258a52014-07-10 16:21:19 -070068
69 MOCK_CONST_METHOD0(server_dictated_poll_interval, unsigned int(void));
Darin Petkov1023a602010-08-30 13:47:51 -070070};
71
72} // namespace chromeos_update_engine
73
Alex Deymo560ae1d2014-10-28 02:17:54 -070074#endif // UPDATE_ENGINE_MOCK_UPDATE_ATTEMPTER_H_