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 22#include "update_engine/update_attempter.h" 23 24#include <gmock/gmock.h> 25 26namespace chromeos_update_engine { 27 28class MockUpdateAttempter : public UpdateAttempter { 29 public: 30 using UpdateAttempter::UpdateAttempter; 31 32 MOCK_METHOD6(Update, void(const std::string& app_version, 33 const std::string& omaha_url, 34 const std::string& target_channel, 35 const std::string& target_version_prefix, 36 bool obey_proxies, 37 bool interactive)); 38 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)); 46 47 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 55 MOCK_CONST_METHOD0(consecutive_failed_update_checks, unsigned int(void)); 56 57 MOCK_CONST_METHOD0(server_dictated_poll_interval, unsigned int(void)); 58 59 MOCK_METHOD0(IsAnyUpdateSourceAllowed, bool(void)); 60}; 61 62} // namespace chromeos_update_engine 63 64#endif // UPDATE_ENGINE_MOCK_UPDATE_ATTEMPTER_H_ 65