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/browser/download/download_item_impl.h" | 5 #include "content/browser/download/download_item_impl.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <iterator> | 9 #include <iterator> |
10 #include <queue> | 10 #include <queue> |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 create_info_->etag = "SomethingToSatisfyResumption"; | 252 create_info_->etag = "SomethingToSatisfyResumption"; |
253 } | 253 } |
254 | 254 |
255 ~DownloadItemTest() { | 255 ~DownloadItemTest() { |
256 RunAllPendingInMessageLoops(); | 256 RunAllPendingInMessageLoops(); |
257 base::STLDeleteElements(&allocated_downloads_); | 257 base::STLDeleteElements(&allocated_downloads_); |
258 } | 258 } |
259 | 259 |
260 DownloadItemImpl* CreateDownloadItemWithCreateInfo( | 260 DownloadItemImpl* CreateDownloadItemWithCreateInfo( |
261 std::unique_ptr<DownloadCreateInfo> info) { | 261 std::unique_ptr<DownloadCreateInfo> info) { |
262 DownloadItemImpl* download = new DownloadItemImpl( | 262 DownloadItemImpl* download = |
263 &delegate_, next_download_id_++, *(info.get()), net::BoundNetLog()); | 263 new DownloadItemImpl(&delegate_, next_download_id_++, *(info.get()), |
| 264 net::NetLogWithSource()); |
264 allocated_downloads_.insert(download); | 265 allocated_downloads_.insert(download); |
265 return download; | 266 return download; |
266 } | 267 } |
267 | 268 |
268 // This class keeps ownership of the created download item; it will | 269 // This class keeps ownership of the created download item; it will |
269 // be torn down at the end of the test unless DestroyDownloadItem is | 270 // be torn down at the end of the test unless DestroyDownloadItem is |
270 // called. | 271 // called. |
271 DownloadItemImpl* CreateDownloadItem() { | 272 DownloadItemImpl* CreateDownloadItem() { |
272 create_info_->download_id = ++next_download_id_; | 273 create_info_->download_id = ++next_download_id_; |
273 DownloadItemImpl* download = | 274 DownloadItemImpl* download = |
274 new DownloadItemImpl(&delegate_, create_info_->download_id, | 275 new DownloadItemImpl(&delegate_, create_info_->download_id, |
275 *create_info_, net::BoundNetLog()); | 276 *create_info_, net::NetLogWithSource()); |
276 allocated_downloads_.insert(download); | 277 allocated_downloads_.insert(download); |
277 return download; | 278 return download; |
278 } | 279 } |
279 | 280 |
280 // Add DownloadFile to DownloadItem. Set |callback| to nullptr if a download | 281 // Add DownloadFile to DownloadItem. Set |callback| to nullptr if a download |
281 // target determination is not expected. | 282 // target determination is not expected. |
282 MockDownloadFile* CallDownloadItemStart( | 283 MockDownloadFile* CallDownloadItemStart( |
283 DownloadItemImpl* item, | 284 DownloadItemImpl* item, |
284 DownloadItemImplDelegate::DownloadTargetCallback* callback) { | 285 DownloadItemImplDelegate::DownloadTargetCallback* callback) { |
285 MockDownloadFile* mock_download_file = nullptr; | 286 MockDownloadFile* mock_download_file = nullptr; |
(...skipping 1739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2025 | 2026 |
2026 item_->Cancel(true); | 2027 item_->Cancel(true); |
2027 RunAllPendingInMessageLoops(); | 2028 RunAllPendingInMessageLoops(); |
2028 } | 2029 } |
2029 | 2030 |
2030 TEST(MockDownloadItem, Compiles) { | 2031 TEST(MockDownloadItem, Compiles) { |
2031 MockDownloadItem mock_item; | 2032 MockDownloadItem mock_item; |
2032 } | 2033 } |
2033 | 2034 |
2034 } // namespace content | 2035 } // namespace content |
OLD | NEW |