| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_PUBLIC_TEST_MOCK_DOWNLOAD_MANAGER_H_ | 5 #ifndef CONTENT_PUBLIC_TEST_MOCK_DOWNLOAD_MANAGER_H_ |
| 6 #define CONTENT_PUBLIC_TEST_MOCK_DOWNLOAD_MANAGER_H_ | 6 #define CONTENT_PUBLIC_TEST_MOCK_DOWNLOAD_MANAGER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 std::string etag; | 46 std::string etag; |
| 47 std::string last_modified; | 47 std::string last_modified; |
| 48 int64_t received_bytes; | 48 int64_t received_bytes; |
| 49 int64_t total_bytes; | 49 int64_t total_bytes; |
| 50 std::string hash; | 50 std::string hash; |
| 51 DownloadItem::DownloadState state; | 51 DownloadItem::DownloadState state; |
| 52 DownloadDangerType danger_type; | 52 DownloadDangerType danger_type; |
| 53 DownloadInterruptReason interrupt_reason; | 53 DownloadInterruptReason interrupt_reason; |
| 54 bool opened; | 54 bool opened; |
| 55 base::Time last_access_time; | 55 base::Time last_access_time; |
| 56 bool visible; |
| 56 std::vector<DownloadItem::ReceivedSlice> received_slices; | 57 std::vector<DownloadItem::ReceivedSlice> received_slices; |
| 57 | 58 |
| 58 CreateDownloadItemAdapter( | 59 CreateDownloadItemAdapter( |
| 59 const std::string& guid, | 60 const std::string& guid, |
| 60 uint32_t id, | 61 uint32_t id, |
| 61 const base::FilePath& current_path, | 62 const base::FilePath& current_path, |
| 62 const base::FilePath& target_path, | 63 const base::FilePath& target_path, |
| 63 const std::vector<GURL>& url_chain, | 64 const std::vector<GURL>& url_chain, |
| 64 const GURL& referrer_url, | 65 const GURL& referrer_url, |
| 65 const GURL& site_url, | 66 const GURL& site_url, |
| 66 const GURL& tab_url, | 67 const GURL& tab_url, |
| 67 const GURL& tab_refererr_url, | 68 const GURL& tab_refererr_url, |
| 68 const std::string& mime_type, | 69 const std::string& mime_type, |
| 69 const std::string& original_mime_type, | 70 const std::string& original_mime_type, |
| 70 const base::Time& start_time, | 71 const base::Time& start_time, |
| 71 const base::Time& end_time, | 72 const base::Time& end_time, |
| 72 const std::string& etag, | 73 const std::string& etag, |
| 73 const std::string& last_modified, | 74 const std::string& last_modified, |
| 74 int64_t received_bytes, | 75 int64_t received_bytes, |
| 75 int64_t total_bytes, | 76 int64_t total_bytes, |
| 76 const std::string& hash, | 77 const std::string& hash, |
| 77 DownloadItem::DownloadState state, | 78 DownloadItem::DownloadState state, |
| 78 DownloadDangerType danger_type, | 79 DownloadDangerType danger_type, |
| 79 DownloadInterruptReason interrupt_reason, | 80 DownloadInterruptReason interrupt_reason, |
| 80 bool opened, | 81 bool opened, |
| 81 const base::Time& last_access_time, | 82 const base::Time& last_access_time, |
| 83 bool visible, |
| 82 const std::vector<DownloadItem::ReceivedSlice>& received_slices); | 84 const std::vector<DownloadItem::ReceivedSlice>& received_slices); |
| 83 // Required by clang compiler. | 85 // Required by clang compiler. |
| 84 CreateDownloadItemAdapter(const CreateDownloadItemAdapter& rhs); | 86 CreateDownloadItemAdapter(const CreateDownloadItemAdapter& rhs); |
| 85 ~CreateDownloadItemAdapter(); | 87 ~CreateDownloadItemAdapter(); |
| 86 | 88 |
| 87 bool operator==(const CreateDownloadItemAdapter& rhs) const; | 89 bool operator==(const CreateDownloadItemAdapter& rhs) const; |
| 88 }; | 90 }; |
| 89 | 91 |
| 90 MockDownloadManager(); | 92 MockDownloadManager(); |
| 91 ~MockDownloadManager() override; | 93 ~MockDownloadManager() override; |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 const std::string& etag, | 136 const std::string& etag, |
| 135 const std::string& last_modified, | 137 const std::string& last_modified, |
| 136 int64_t received_bytes, | 138 int64_t received_bytes, |
| 137 int64_t total_bytes, | 139 int64_t total_bytes, |
| 138 const std::string& hash, | 140 const std::string& hash, |
| 139 DownloadItem::DownloadState state, | 141 DownloadItem::DownloadState state, |
| 140 DownloadDangerType danger_type, | 142 DownloadDangerType danger_type, |
| 141 DownloadInterruptReason interrupt_reason, | 143 DownloadInterruptReason interrupt_reason, |
| 142 bool opened, | 144 bool opened, |
| 143 const base::Time& last_access_time, | 145 const base::Time& last_access_time, |
| 146 bool visible, |
| 144 const std::vector<DownloadItem::ReceivedSlice>& received_slices) override; | 147 const std::vector<DownloadItem::ReceivedSlice>& received_slices) override; |
| 145 | 148 |
| 146 MOCK_METHOD1(MockCreateDownloadItem, | 149 MOCK_METHOD1(MockCreateDownloadItem, |
| 147 DownloadItem*(CreateDownloadItemAdapter adapter)); | 150 DownloadItem*(CreateDownloadItemAdapter adapter)); |
| 148 | 151 |
| 149 MOCK_CONST_METHOD0(InProgressCount, int()); | 152 MOCK_CONST_METHOD0(InProgressCount, int()); |
| 150 MOCK_CONST_METHOD0(NonMaliciousInProgressCount, int()); | 153 MOCK_CONST_METHOD0(NonMaliciousInProgressCount, int()); |
| 151 MOCK_CONST_METHOD0(GetBrowserContext, BrowserContext*()); | 154 MOCK_CONST_METHOD0(GetBrowserContext, BrowserContext*()); |
| 152 MOCK_METHOD0(CheckForHistoryFilesRemoval, void()); | 155 MOCK_METHOD0(CheckForHistoryFilesRemoval, void()); |
| 153 MOCK_METHOD1(GetDownload, DownloadItem*(uint32_t id)); | 156 MOCK_METHOD1(GetDownload, DownloadItem*(uint32_t id)); |
| 154 MOCK_METHOD1(GetDownloadByGuid, DownloadItem*(const std::string&)); | 157 MOCK_METHOD1(GetDownloadByGuid, DownloadItem*(const std::string&)); |
| 155 }; | 158 }; |
| 156 | 159 |
| 157 } // namespace content | 160 } // namespace content |
| 158 | 161 |
| 159 #endif // CONTENT_PUBLIC_TEST_MOCK_DOWNLOAD_MANAGER_H_ | 162 #endif // CONTENT_PUBLIC_TEST_MOCK_DOWNLOAD_MANAGER_H_ |
| OLD | NEW |