mock_update_attempter.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. #ifndef UPDATE_ENGINE_MOCK_UPDATE_ATTEMPTER_H_
  17. #define UPDATE_ENGINE_MOCK_UPDATE_ATTEMPTER_H_
  18. #include <string>
  19. #include <vector>
  20. #include "update_engine/update_attempter.h"
  21. #include <gmock/gmock.h>
  22. namespace chromeos_update_engine {
  23. class MockUpdateAttempter : public UpdateAttempter {
  24. public:
  25. using UpdateAttempter::UpdateAttempter;
  26. MOCK_METHOD7(Update,
  27. void(const std::string& app_version,
  28. const std::string& omaha_url,
  29. const std::string& target_channel,
  30. const std::string& target_version_prefix,
  31. bool rollback_allowed,
  32. bool obey_proxies,
  33. bool interactive));
  34. MOCK_METHOD1(GetStatus, bool(update_engine::UpdateEngineStatus* out_status));
  35. MOCK_METHOD1(GetBootTimeAtUpdate, bool(base::Time* out_boot_time));
  36. MOCK_METHOD0(ResetStatus, bool(void));
  37. MOCK_CONST_METHOD0(GetCurrentUpdateAttemptFlags, UpdateAttemptFlags(void));
  38. MOCK_METHOD3(CheckForUpdate,
  39. bool(const std::string& app_version,
  40. const std::string& omaha_url,
  41. UpdateAttemptFlags flags));
  42. MOCK_METHOD2(CheckForInstall,
  43. bool(const std::vector<std::string>& dlc_module_ids,
  44. const std::string& omaha_url));
  45. MOCK_METHOD0(RefreshDevicePolicy, void(void));
  46. MOCK_CONST_METHOD0(consecutive_failed_update_checks, unsigned int(void));
  47. MOCK_CONST_METHOD0(server_dictated_poll_interval, unsigned int(void));
  48. };
  49. } // namespace chromeos_update_engine
  50. #endif // UPDATE_ENGINE_MOCK_UPDATE_ATTEMPTER_H_