blob: 049624bb524ebe3e0035147fec2b58416d0eaf8a [file] [log] [blame]
Jay Srinivasan6f6ea002012-12-14 11:26:28 -08001// 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 Srinivasan2b5a0f02012-12-19 17:25:56 -08009#include "update_engine/omaha_request_action.h"
10#include "update_engine/payload_state_interface.h"
Jay Srinivasan6f6ea002012-12-14 11:26:28 -080011
12namespace chromeos_update_engine {
13
Jay Srinivasan2b5a0f02012-12-19 17:25:56 -080014class MockPayloadState: public PayloadStateInterface {
Jay Srinivasan6f6ea002012-12-14 11:26:28 -080015 public:
Jay Srinivasan2b5a0f02012-12-19 17:25:56 -080016 bool Initialize(PrefsInterface* prefs) {
17 return true;
18 }
19
Jay Srinivasan08262882012-12-28 19:29:43 -080020 // Significant methods.
Jay Srinivasan2b5a0f02012-12-19 17:25:56 -080021 MOCK_METHOD1(SetResponse, void(const OmahaResponse& response));
22 MOCK_METHOD0(DownloadComplete, void());
23 MOCK_METHOD1(DownloadProgress, void(size_t count));
Jay Srinivasan6f6ea002012-12-14 11:26:28 -080024 MOCK_METHOD1(UpdateFailed, void(ActionExitCode error));
Jay Srinivasan08262882012-12-28 19:29:43 -080025 MOCK_METHOD0(ShouldBackoffDownload, bool());
26
27 // Getters.
28 MOCK_METHOD0(GetResponseSignature, std::string());
Jay Srinivasan2b5a0f02012-12-19 17:25:56 -080029 MOCK_METHOD0(GetPayloadAttemptNumber, uint32_t());
30 MOCK_METHOD0(GetUrlIndex, uint32_t());
31 MOCK_METHOD0(GetUrlFailureCount, uint32_t());
Jay Srinivasan08262882012-12-28 19:29:43 -080032 MOCK_METHOD0(GetBackoffExpiryTime, base::Time());
Jay Srinivasan6f6ea002012-12-14 11:26:28 -080033};
34
35} // namespace chromeos_update_engine
36
37#endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_MOCK_PAYLOAD_STATE_H__