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 #include <vector>
22 
23 #include "update_engine/update_attempter.h"
24 
25 #include <gmock/gmock.h>
26 
27 namespace chromeos_update_engine {
28 
29 class MockUpdateAttempter : public UpdateAttempter {
30  public:
31   using UpdateAttempter::UpdateAttempter;
32 
33   MOCK_METHOD9(Update,
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,
39                     bool rollback_data_save_requested,
40                     int rollback_allowed_milestones,
41                     bool obey_proxies,
42                     bool interactive));
43 
44   MOCK_METHOD1(GetStatus, bool(update_engine::UpdateEngineStatus* out_status));
45 
46   MOCK_METHOD1(GetBootTimeAtUpdate, bool(base::Time* out_boot_time));
47 
48   MOCK_METHOD0(ResetStatus, bool(void));
49 
50   MOCK_CONST_METHOD0(GetCurrentUpdateAttemptFlags, UpdateAttemptFlags(void));
51 
52   MOCK_METHOD3(CheckForUpdate,
53                bool(const std::string& app_version,
54                     const std::string& omaha_url,
55                     UpdateAttemptFlags flags));
56 
57   MOCK_METHOD2(CheckForInstall,
58                bool(const std::vector<std::string>& dlc_ids,
59                     const std::string& omaha_url));
60 
61   MOCK_METHOD2(SetDlcActiveValue, bool(bool, const std::string&));
62 
63   MOCK_CONST_METHOD0(GetExcluder, ExcluderInterface*(void));
64 
65   MOCK_METHOD0(RefreshDevicePolicy, void(void));
66 
67   MOCK_CONST_METHOD0(consecutive_failed_update_checks, unsigned int(void));
68 
69   MOCK_CONST_METHOD0(server_dictated_poll_interval, unsigned int(void));
70 };
71 
72 }  // namespace chromeos_update_engine
73 
74 #endif  // UPDATE_ENGINE_MOCK_UPDATE_ATTEMPTER_H_
75