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 #include "content/public/test/mock_download_manager.h" | 5 #include "content/public/test/mock_download_manager.h" |
6 | 6 |
7 #include "content/browser/byte_stream.h" | 7 #include "content/browser/byte_stream.h" |
8 #include "content/browser/download/download_create_info.h" | 8 #include "content/browser/download/download_create_info.h" |
9 | 9 |
10 namespace content { | 10 namespace content { |
11 | 11 |
12 MockDownloadManager::CreateDownloadItemAdapter::CreateDownloadItemAdapter( | 12 MockDownloadManager::CreateDownloadItemAdapter::CreateDownloadItemAdapter( |
13 const std::string& guid, | 13 const std::string& guid, |
14 uint32_t id, | 14 uint32_t id, |
15 const base::FilePath& current_path, | 15 const base::FilePath& current_path, |
16 const base::FilePath& target_path, | 16 const base::FilePath& target_path, |
17 const std::vector<GURL>& url_chain, | 17 const std::vector<GURL>& url_chain, |
18 const GURL& referrer_url, | 18 const GURL& referrer_url, |
19 const std::string& mime_type, | 19 const std::string& mime_type, |
20 const std::string& original_mime_type, | 20 const std::string& original_mime_type, |
21 const base::Time& start_time, | 21 const base::Time& start_time, |
22 const base::Time& end_time, | 22 const base::Time& end_time, |
23 const std::string& etag, | 23 const std::string& etag, |
24 const std::string& last_modified, | 24 const std::string& last_modified, |
25 int64_t received_bytes, | 25 int64_t received_bytes, |
26 int64_t total_bytes, | 26 int64_t total_bytes, |
| 27 const std::string& hash, |
27 DownloadItem::DownloadState state, | 28 DownloadItem::DownloadState state, |
28 DownloadDangerType danger_type, | 29 DownloadDangerType danger_type, |
29 DownloadInterruptReason interrupt_reason, | 30 DownloadInterruptReason interrupt_reason, |
30 bool opened) | 31 bool opened) |
31 : guid(guid), | 32 : guid(guid), |
32 id(id), | 33 id(id), |
33 current_path(current_path), | 34 current_path(current_path), |
34 target_path(target_path), | 35 target_path(target_path), |
35 url_chain(url_chain), | 36 url_chain(url_chain), |
36 referrer_url(referrer_url), | 37 referrer_url(referrer_url), |
37 mime_type(mime_type), | 38 mime_type(mime_type), |
38 original_mime_type(original_mime_type), | 39 original_mime_type(original_mime_type), |
39 start_time(start_time), | 40 start_time(start_time), |
40 end_time(end_time), | 41 end_time(end_time), |
41 received_bytes(received_bytes), | 42 received_bytes(received_bytes), |
42 total_bytes(total_bytes), | 43 total_bytes(total_bytes), |
| 44 hash(hash), |
43 state(state), | 45 state(state), |
44 danger_type(danger_type), | 46 danger_type(danger_type), |
45 interrupt_reason(interrupt_reason), | 47 interrupt_reason(interrupt_reason), |
46 opened(opened) {} | 48 opened(opened) {} |
47 | 49 |
48 MockDownloadManager::CreateDownloadItemAdapter::CreateDownloadItemAdapter( | 50 MockDownloadManager::CreateDownloadItemAdapter::CreateDownloadItemAdapter( |
49 const CreateDownloadItemAdapter& rhs) | 51 const CreateDownloadItemAdapter& rhs) |
50 : guid(rhs.guid), | 52 : guid(rhs.guid), |
51 id(rhs.id), | 53 id(rhs.id), |
52 current_path(rhs.current_path), | 54 current_path(rhs.current_path), |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 const std::vector<GURL>& url_chain, | 101 const std::vector<GURL>& url_chain, |
100 const GURL& referrer_url, | 102 const GURL& referrer_url, |
101 const std::string& mime_type, | 103 const std::string& mime_type, |
102 const std::string& original_mime_type, | 104 const std::string& original_mime_type, |
103 const base::Time& start_time, | 105 const base::Time& start_time, |
104 const base::Time& end_time, | 106 const base::Time& end_time, |
105 const std::string& etag, | 107 const std::string& etag, |
106 const std::string& last_modified, | 108 const std::string& last_modified, |
107 int64_t received_bytes, | 109 int64_t received_bytes, |
108 int64_t total_bytes, | 110 int64_t total_bytes, |
| 111 const std::string& hash, |
109 DownloadItem::DownloadState state, | 112 DownloadItem::DownloadState state, |
110 DownloadDangerType danger_type, | 113 DownloadDangerType danger_type, |
111 DownloadInterruptReason interrupt_reason, | 114 DownloadInterruptReason interrupt_reason, |
112 bool opened) { | 115 bool opened) { |
113 CreateDownloadItemAdapter adapter(guid, | 116 CreateDownloadItemAdapter adapter(guid, |
114 id, | 117 id, |
115 current_path, | 118 current_path, |
116 target_path, | 119 target_path, |
117 url_chain, | 120 url_chain, |
118 referrer_url, | 121 referrer_url, |
119 mime_type, | 122 mime_type, |
120 original_mime_type, | 123 original_mime_type, |
121 start_time, | 124 start_time, |
122 end_time, | 125 end_time, |
123 etag, | 126 etag, |
124 last_modified, | 127 last_modified, |
125 received_bytes, | 128 received_bytes, |
126 total_bytes, | 129 total_bytes, |
| 130 hash, |
127 state, | 131 state, |
128 danger_type, | 132 danger_type, |
129 interrupt_reason, | 133 interrupt_reason, |
130 opened); | 134 opened); |
131 return MockCreateDownloadItem(adapter); | 135 return MockCreateDownloadItem(adapter); |
132 } | 136 } |
133 | 137 |
134 } // namespace content | 138 } // namespace content |
OLD | NEW |