Jay Srinivasan | 6f6ea00 | 2012-12-14 11:26:28 -0800 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium OS Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef CHROMEOS_PLATFORM_UPDATE_ENGINE_MOCK_PAYLOAD_STATE_H__ |
| 6 | #define CHROMEOS_PLATFORM_UPDATE_ENGINE_MOCK_PAYLOAD_STATE_H__ |
| 7 | |
| 8 | #include "gmock/gmock.h" |
Jay Srinivasan | 2b5a0f0 | 2012-12-19 17:25:56 -0800 | [diff] [blame] | 9 | #include "update_engine/omaha_request_action.h" |
| 10 | #include "update_engine/payload_state_interface.h" |
Jay Srinivasan | 6f6ea00 | 2012-12-14 11:26:28 -0800 | [diff] [blame] | 11 | |
| 12 | namespace chromeos_update_engine { |
| 13 | |
Jay Srinivasan | 2b5a0f0 | 2012-12-19 17:25:56 -0800 | [diff] [blame] | 14 | class MockPayloadState: public PayloadStateInterface { |
Jay Srinivasan | 6f6ea00 | 2012-12-14 11:26:28 -0800 | [diff] [blame] | 15 | public: |
Jay Srinivasan | 2b5a0f0 | 2012-12-19 17:25:56 -0800 | [diff] [blame] | 16 | bool Initialize(PrefsInterface* prefs) { |
| 17 | return true; |
| 18 | } |
| 19 | |
Jay Srinivasan | 0826288 | 2012-12-28 19:29:43 -0800 | [diff] [blame] | 20 | // Significant methods. |
Jay Srinivasan | 2b5a0f0 | 2012-12-19 17:25:56 -0800 | [diff] [blame] | 21 | MOCK_METHOD1(SetResponse, void(const OmahaResponse& response)); |
| 22 | MOCK_METHOD0(DownloadComplete, void()); |
| 23 | MOCK_METHOD1(DownloadProgress, void(size_t count)); |
Jay Srinivasan | 6f6ea00 | 2012-12-14 11:26:28 -0800 | [diff] [blame] | 24 | MOCK_METHOD1(UpdateFailed, void(ActionExitCode error)); |
Jay Srinivasan | 0826288 | 2012-12-28 19:29:43 -0800 | [diff] [blame] | 25 | MOCK_METHOD0(ShouldBackoffDownload, bool()); |
| 26 | |
| 27 | // Getters. |
| 28 | MOCK_METHOD0(GetResponseSignature, std::string()); |
Jay Srinivasan | 2b5a0f0 | 2012-12-19 17:25:56 -0800 | [diff] [blame] | 29 | MOCK_METHOD0(GetPayloadAttemptNumber, uint32_t()); |
| 30 | MOCK_METHOD0(GetUrlIndex, uint32_t()); |
| 31 | MOCK_METHOD0(GetUrlFailureCount, uint32_t()); |
Jay Srinivasan | 0826288 | 2012-12-28 19:29:43 -0800 | [diff] [blame] | 32 | MOCK_METHOD0(GetBackoffExpiryTime, base::Time()); |
Jay Srinivasan | 6f6ea00 | 2012-12-14 11:26:28 -0800 | [diff] [blame] | 33 | }; |
| 34 | |
| 35 | } // namespace chromeos_update_engine |
| 36 | |
| 37 | #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_MOCK_PAYLOAD_STATE_H__ |