blob: 2e97b04a926a780eaea622974276b69a4699b0ec [file] [log] [blame]
[email protected]fd3a82832012-01-19 20:35:121// Copyright (c) 2012 The Chromium Authors. All rights reserved.
[email protected]f6c2b5312011-11-16 22:31:392// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef CONTENT_BROWSER_DOWNLOAD_MOCK_DOWNLOAD_FILE_H_
6#define CONTENT_BROWSER_DOWNLOAD_MOCK_DOWNLOAD_FILE_H_
7#pragma once
8
9#include <string>
10#include <map>
11
12#include "base/file_path.h"
13#include "base/memory/ref_counted.h"
[email protected]f6c2b5312011-11-16 22:31:3914#include "content/browser/download/download_id.h"
[email protected]f6c2b5312011-11-16 22:31:3915#include "content/browser/download/download_request_handle.h"
[email protected]e582fdd2011-12-20 16:48:1716#include "content/public/browser/download_file.h"
17#include "content/public/browser/download_manager.h"
[email protected]f6c2b5312011-11-16 22:31:3918#include "net/base/net_errors.h"
[email protected]fd3a82832012-01-19 20:35:1219#include "testing/gmock/include/gmock/gmock.h"
20#include "testing/gtest/include/gtest/gtest.h"
[email protected]f6c2b5312011-11-16 22:31:3921
22struct DownloadCreateInfo;
23
[email protected]e582fdd2011-12-20 16:48:1724class MockDownloadFile : virtual public content::DownloadFile {
[email protected]f6c2b5312011-11-16 22:31:3925 public:
[email protected]fd3a82832012-01-19 20:35:1226 MockDownloadFile();
[email protected]f6c2b5312011-11-16 22:31:3927 virtual ~MockDownloadFile();
28
29 // DownloadFile functions.
[email protected]fd3a82832012-01-19 20:35:1230 MOCK_METHOD0(Initialize, net::Error());
31 MOCK_METHOD2(AppendDataToFile, net::Error(const char* data, size_t data_len));
32 MOCK_METHOD1(Rename, net::Error(const FilePath& full_path));
33 MOCK_METHOD0(Detach, void());
34 MOCK_METHOD0(Cancel, void());
35 MOCK_METHOD0(Finish, void());
36 MOCK_METHOD0(AnnotateWithSourceInformation, void());
37 MOCK_CONST_METHOD0(FullPath, FilePath());
38 MOCK_CONST_METHOD0(InProgress, bool());
39 MOCK_CONST_METHOD0(BytesSoFar, int64());
40 MOCK_CONST_METHOD0(CurrentSpeed, int64());
41 MOCK_METHOD1(GetHash, bool(std::string* hash));
42 MOCK_METHOD0(GetHashState, std::string());
43 MOCK_METHOD0(CancelDownloadRequest, void());
44 MOCK_CONST_METHOD0(Id, int());
45 MOCK_METHOD0(GetDownloadManager, content::DownloadManager*());
46 MOCK_CONST_METHOD0(GlobalId, const DownloadId&());
47 MOCK_CONST_METHOD0(DebugString, std::string());
[email protected]f6c2b5312011-11-16 22:31:3948};
49
50#endif // CONTENT_BROWSER_DOWNLOAD_MOCK_DOWNLOAD_FILE_H_