blob: 89f163ed805d4e5d6e3cc72a234fe6afa7352345 [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>
21
Darin Petkov1023a602010-08-30 13:47:51 -070022#include "update_engine/update_attempter.h"
23
Gilad Arnold76b2b482014-04-01 13:32:43 -070024#include <gmock/gmock.h>
25
Darin Petkov1023a602010-08-30 13:47:51 -070026namespace chromeos_update_engine {
27
Alex Deymo560ae1d2014-10-28 02:17:54 -070028class MockUpdateAttempter : public UpdateAttempter {
Darin Petkov1023a602010-08-30 13:47:51 -070029 public:
Gilad Arnold76b2b482014-04-01 13:32:43 -070030 using UpdateAttempter::UpdateAttempter;
Darin Petkov1023a602010-08-30 13:47:51 -070031
Gilad Arnoldec7f9162014-07-15 13:24:46 -070032 MOCK_METHOD6(Update, void(const std::string& app_version,
Andrew de los Reyes45168102010-11-22 11:13:50 -080033 const std::string& omaha_url,
Gilad Arnoldec7f9162014-07-15 13:24:46 -070034 const std::string& target_channel,
35 const std::string& target_version_prefix,
Andrew de los Reyesfb2f4612011-06-09 18:21:49 -070036 bool obey_proxies,
Nam T. Nguyen7d623eb2014-05-13 16:06:28 -070037 bool interactive));
Gilad Arnold76b2b482014-04-01 13:32:43 -070038
39 MOCK_METHOD5(GetStatus, bool(int64_t* last_checked_time,
40 double* progress,
41 std::string* current_operation,
42 std::string* new_version,
43 int64_t* new_size));
44
45 MOCK_METHOD1(GetBootTimeAtUpdate, bool(base::Time* out_boot_time));
Gilad Arnolda6dab942014-04-25 11:46:03 -070046
Alex Deymo560ae1d2014-10-28 02:17:54 -070047 MOCK_METHOD0(ResetStatus, bool(void));
48
49 MOCK_METHOD3(CheckForUpdate, void(const std::string& app_version,
50 const std::string& omaha_url,
51 bool is_interactive));
52
53 MOCK_METHOD0(RefreshDevicePolicy, void(void));
54
Gilad Arnolda6dab942014-04-25 11:46:03 -070055 MOCK_CONST_METHOD0(consecutive_failed_update_checks, unsigned int(void));
Gilad Arnolda0258a52014-07-10 16:21:19 -070056
57 MOCK_CONST_METHOD0(server_dictated_poll_interval, unsigned int(void));
David Pursell02c18642014-11-06 11:26:11 -080058
59 MOCK_METHOD0(IsAnyUpdateSourceAllowed, bool(void));
Darin Petkov1023a602010-08-30 13:47:51 -070060};
61
62} // namespace chromeos_update_engine
63
Alex Deymo560ae1d2014-10-28 02:17:54 -070064#endif // UPDATE_ENGINE_MOCK_UPDATE_ATTEMPTER_H_