[email protected] | fd3a8283 | 2012-01-19 20:35:12 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
[email protected] | f6c2b531 | 2011-11-16 22:31:39 | [diff] [blame] | 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 CONTENT_BROWSER_DOWNLOAD_MOCK_DOWNLOAD_FILE_H_ |
| 6 | #define CONTENT_BROWSER_DOWNLOAD_MOCK_DOWNLOAD_FILE_H_ |
[email protected] | f6c2b531 | 2011-11-16 22:31:39 | [diff] [blame] | 7 | |
| 8 | #include <string> |
| 9 | #include <map> |
| 10 | |
| 11 | #include "base/file_path.h" |
| 12 | #include "base/memory/ref_counted.h" |
[email protected] | f363dae | 2012-01-31 06:08:23 | [diff] [blame] | 13 | #include "content/browser/download/download_file.h" |
[email protected] | 98e81406 | 2012-01-27 00:35:42 | [diff] [blame] | 14 | #include "content/public/browser/download_id.h" |
[email protected] | e582fdd | 2011-12-20 16:48:17 | [diff] [blame] | 15 | #include "content/public/browser/download_manager.h" |
[email protected] | fd3a8283 | 2012-01-19 20:35:12 | [diff] [blame] | 16 | #include "testing/gmock/include/gmock/gmock.h" |
| 17 | #include "testing/gtest/include/gtest/gtest.h" |
[email protected] | f6c2b531 | 2011-11-16 22:31:39 | [diff] [blame] | 18 | |
[email protected] | 3586962 | 2012-10-26 23:23:55 | [diff] [blame] | 19 | namespace content { |
[email protected] | f6c2b531 | 2011-11-16 22:31:39 | [diff] [blame] | 20 | struct DownloadCreateInfo; |
| 21 | |
[email protected] | 3586962 | 2012-10-26 23:23:55 | [diff] [blame] | 22 | class MockDownloadFile : virtual public DownloadFile { |
[email protected] | f6c2b531 | 2011-11-16 22:31:39 | [diff] [blame] | 23 | public: |
[email protected] | fd3a8283 | 2012-01-19 20:35:12 | [diff] [blame] | 24 | MockDownloadFile(); |
[email protected] | f6c2b531 | 2011-11-16 22:31:39 | [diff] [blame] | 25 | virtual ~MockDownloadFile(); |
| 26 | |
| 27 | // DownloadFile functions. |
[email protected] | 53ac00e8 | 2012-10-18 20:59:20 | [diff] [blame] | 28 | MOCK_METHOD1(Initialize, void(const InitializeCallback&)); |
[email protected] | 3586962 | 2012-10-26 23:23:55 | [diff] [blame] | 29 | MOCK_METHOD2(AppendDataToFile, DownloadInterruptReason( |
[email protected] | c4e8c33f | 2012-07-03 20:47:39 | [diff] [blame] | 30 | const char* data, size_t data_len)); |
[email protected] | 3586962 | 2012-10-26 23:23:55 | [diff] [blame] | 31 | MOCK_METHOD1(Rename, DownloadInterruptReason(const FilePath& full_path)); |
[email protected] | d682597 | 2012-11-10 01:22:52 | [diff] [blame^] | 32 | 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] | fd3a8283 | 2012-01-19 20:35:12 | [diff] [blame] | 39 | MOCK_METHOD0(Cancel, void()); |
| 40 | MOCK_METHOD0(Finish, void()); |
[email protected] | fd3a8283 | 2012-01-19 20:35:12 | [diff] [blame] | 41 | 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] | b36cad50 | 2012-07-13 23:19:14 | [diff] [blame] | 47 | MOCK_METHOD0(SendUpdate, void()); |
[email protected] | fd3a8283 | 2012-01-19 20:35:12 | [diff] [blame] | 48 | MOCK_CONST_METHOD0(Id, int()); |
[email protected] | 3586962 | 2012-10-26 23:23:55 | [diff] [blame] | 49 | MOCK_METHOD0(GetDownloadManager, DownloadManager*()); |
| 50 | MOCK_CONST_METHOD0(GlobalId, const DownloadId&()); |
[email protected] | fd3a8283 | 2012-01-19 20:35:12 | [diff] [blame] | 51 | MOCK_CONST_METHOD0(DebugString, std::string()); |
[email protected] | f6c2b531 | 2011-11-16 22:31:39 | [diff] [blame] | 52 | }; |
| 53 | |
[email protected] | 3586962 | 2012-10-26 23:23:55 | [diff] [blame] | 54 | } // namespace content |
| 55 | |
[email protected] | f6c2b531 | 2011-11-16 22:31:39 | [diff] [blame] | 56 | #endif // CONTENT_BROWSER_DOWNLOAD_MOCK_DOWNLOAD_FILE_H_ |