blob: 9756ac9ace1c40e1a636b6dcb7cfb7994ae5e3da [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
20 MOCK_METHOD1(SetResponse, void(const OmahaResponse& response));
21 MOCK_METHOD0(DownloadComplete, void());
22 MOCK_METHOD1(DownloadProgress, void(size_t count));
Jay Srinivasan6f6ea002012-12-14 11:26:28 -080023 MOCK_METHOD1(UpdateFailed, void(ActionExitCode error));
Jay Srinivasan2b5a0f02012-12-19 17:25:56 -080024 MOCK_METHOD0(GetResponse, std::string());
25 MOCK_METHOD0(GetPayloadAttemptNumber, uint32_t());
26 MOCK_METHOD0(GetUrlIndex, uint32_t());
27 MOCK_METHOD0(GetUrlFailureCount, uint32_t());
Jay Srinivasan6f6ea002012-12-14 11:26:28 -080028};
29
30} // namespace chromeos_update_engine
31
32#endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_MOCK_PAYLOAD_STATE_H__