blob: 51f47d57cd056662f8b6dbf5b5c9b52c0e46dee4 [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_
[email protected]f6c2b5312011-11-16 22:31:397
8#include <string>
9#include <map>
10
11#include "base/file_path.h"
12#include "base/memory/ref_counted.h"
[email protected]f363dae2012-01-31 06:08:2313#include "content/browser/download/download_file.h"
[email protected]98e814062012-01-27 00:35:4214#include "content/public/browser/download_id.h"
[email protected]e582fdd2011-12-20 16:48:1715#include "content/public/browser/download_manager.h"
[email protected]fd3a82832012-01-19 20:35:1216#include "testing/gmock/include/gmock/gmock.h"
17#include "testing/gtest/include/gtest/gtest.h"
[email protected]f6c2b5312011-11-16 22:31:3918
[email protected]35869622012-10-26 23:23:5519namespace content {
[email protected]f6c2b5312011-11-16 22:31:3920struct DownloadCreateInfo;
21
[email protected]35869622012-10-26 23:23:5522class MockDownloadFile : virtual public DownloadFile {
[email protected]f6c2b5312011-11-16 22:31:3923 public:
[email protected]fd3a82832012-01-19 20:35:1224 MockDownloadFile();
[email protected]f6c2b5312011-11-16 22:31:3925 virtual ~MockDownloadFile();
26
27 // DownloadFile functions.
[email protected]53ac00e82012-10-18 20:59:2028 MOCK_METHOD1(Initialize, void(const InitializeCallback&));
[email protected]35869622012-10-26 23:23:5529 MOCK_METHOD2(AppendDataToFile, DownloadInterruptReason(
[email protected]c4e8c33f2012-07-03 20:47:3930 const char* data, size_t data_len));
[email protected]35869622012-10-26 23:23:5531 MOCK_METHOD1(Rename, DownloadInterruptReason(const FilePath& full_path));
[email protected]d6825972012-11-10 01:22:5232 MOCK_METHOD2(RenameAndUniquify,
33 void(const FilePath& full_path,
34 const RenameCompletionCallback& callback));
35 MOCK_METHOD2(RenameAndAnnotate,
36 void(const FilePath& full_path,
37 const RenameCompletionCallback& callback));
38 MOCK_METHOD0(Detach, void());
[email protected]fd3a82832012-01-19 20:35:1239 MOCK_METHOD0(Cancel, void());
40 MOCK_METHOD0(Finish, void());
[email protected]fd3a82832012-01-19 20:35:1241 MOCK_CONST_METHOD0(FullPath, FilePath());
42 MOCK_CONST_METHOD0(InProgress, bool());
43 MOCK_CONST_METHOD0(BytesSoFar, int64());
44 MOCK_CONST_METHOD0(CurrentSpeed, int64());
45 MOCK_METHOD1(GetHash, bool(std::string* hash));
46 MOCK_METHOD0(GetHashState, std::string());
[email protected]b36cad502012-07-13 23:19:1447 MOCK_METHOD0(SendUpdate, void());
[email protected]fd3a82832012-01-19 20:35:1248 MOCK_CONST_METHOD0(Id, int());
[email protected]35869622012-10-26 23:23:5549 MOCK_METHOD0(GetDownloadManager, DownloadManager*());
50 MOCK_CONST_METHOD0(GlobalId, const DownloadId&());
[email protected]fd3a82832012-01-19 20:35:1251 MOCK_CONST_METHOD0(DebugString, std::string());
[email protected]f6c2b5312011-11-16 22:31:3952};
53
[email protected]35869622012-10-26 23:23:5554} // namespace content
55
[email protected]f6c2b5312011-11-16 22:31:3956#endif // CONTENT_BROWSER_DOWNLOAD_MOCK_DOWNLOAD_FILE_H_