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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 base::Time end_time; | 45 base::Time end_time; |
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 | 56 |
56 CreateDownloadItemAdapter(const std::string& guid, | 57 CreateDownloadItemAdapter(const std::string& guid, |
57 uint32_t id, | 58 uint32_t id, |
58 const base::FilePath& current_path, | 59 const base::FilePath& current_path, |
59 const base::FilePath& target_path, | 60 const base::FilePath& target_path, |
60 const std::vector<GURL>& url_chain, | 61 const std::vector<GURL>& url_chain, |
61 const GURL& referrer_url, | 62 const GURL& referrer_url, |
62 const GURL& site_url, | 63 const GURL& site_url, |
63 const GURL& tab_url, | 64 const GURL& tab_url, |
64 const GURL& tab_refererr_url, | 65 const GURL& tab_refererr_url, |
65 const std::string& mime_type, | 66 const std::string& mime_type, |
66 const std::string& original_mime_type, | 67 const std::string& original_mime_type, |
67 const base::Time& start_time, | 68 const base::Time& start_time, |
68 const base::Time& end_time, | 69 const base::Time& end_time, |
69 const std::string& etag, | 70 const std::string& etag, |
70 const std::string& last_modified, | 71 const std::string& last_modified, |
71 int64_t received_bytes, | 72 int64_t received_bytes, |
72 int64_t total_bytes, | 73 int64_t total_bytes, |
73 const std::string& hash, | 74 const std::string& hash, |
74 DownloadItem::DownloadState state, | 75 DownloadItem::DownloadState state, |
75 DownloadDangerType danger_type, | 76 DownloadDangerType danger_type, |
76 DownloadInterruptReason interrupt_reason, | 77 DownloadInterruptReason interrupt_reason, |
77 bool opened); | 78 bool opened, |
| 79 const base::Time& last_access_time); |
78 // Required by clang compiler. | 80 // Required by clang compiler. |
79 CreateDownloadItemAdapter(const CreateDownloadItemAdapter& rhs); | 81 CreateDownloadItemAdapter(const CreateDownloadItemAdapter& rhs); |
80 ~CreateDownloadItemAdapter(); | 82 ~CreateDownloadItemAdapter(); |
81 | 83 |
82 bool operator==(const CreateDownloadItemAdapter& rhs) const; | 84 bool operator==(const CreateDownloadItemAdapter& rhs) const; |
83 }; | 85 }; |
84 | 86 |
85 MockDownloadManager(); | 87 MockDownloadManager(); |
86 ~MockDownloadManager() override; | 88 ~MockDownloadManager() override; |
87 | 89 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 const base::Time& start_time, | 128 const base::Time& start_time, |
127 const base::Time& end_time, | 129 const base::Time& end_time, |
128 const std::string& etag, | 130 const std::string& etag, |
129 const std::string& last_modified, | 131 const std::string& last_modified, |
130 int64_t received_bytes, | 132 int64_t received_bytes, |
131 int64_t total_bytes, | 133 int64_t total_bytes, |
132 const std::string& hash, | 134 const std::string& hash, |
133 DownloadItem::DownloadState state, | 135 DownloadItem::DownloadState state, |
134 DownloadDangerType danger_type, | 136 DownloadDangerType danger_type, |
135 DownloadInterruptReason interrupt_reason, | 137 DownloadInterruptReason interrupt_reason, |
136 bool opened) override; | 138 bool opened, |
| 139 const base::Time& last_access_time) override; |
137 | 140 |
138 MOCK_METHOD1(MockCreateDownloadItem, | 141 MOCK_METHOD1(MockCreateDownloadItem, |
139 DownloadItem*(CreateDownloadItemAdapter adapter)); | 142 DownloadItem*(CreateDownloadItemAdapter adapter)); |
140 | 143 |
141 MOCK_CONST_METHOD0(InProgressCount, int()); | 144 MOCK_CONST_METHOD0(InProgressCount, int()); |
142 MOCK_CONST_METHOD0(NonMaliciousInProgressCount, int()); | 145 MOCK_CONST_METHOD0(NonMaliciousInProgressCount, int()); |
143 MOCK_CONST_METHOD0(GetBrowserContext, BrowserContext*()); | 146 MOCK_CONST_METHOD0(GetBrowserContext, BrowserContext*()); |
144 MOCK_METHOD0(CheckForHistoryFilesRemoval, void()); | 147 MOCK_METHOD0(CheckForHistoryFilesRemoval, void()); |
145 MOCK_METHOD1(GetDownload, DownloadItem*(uint32_t id)); | 148 MOCK_METHOD1(GetDownload, DownloadItem*(uint32_t id)); |
146 MOCK_METHOD1(GetDownloadByGuid, DownloadItem*(const std::string&)); | 149 MOCK_METHOD1(GetDownloadByGuid, DownloadItem*(const std::string&)); |
147 }; | 150 }; |
148 | 151 |
149 } // namespace content | 152 } // namespace content |
150 | 153 |
151 #endif // CONTENT_PUBLIC_TEST_MOCK_DOWNLOAD_MANAGER_H_ | 154 #endif // CONTENT_PUBLIC_TEST_MOCK_DOWNLOAD_MANAGER_H_ |
OLD | NEW |