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/download/byte_stream.h" | 7 #include "content/browser/download/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 void PrintTo(const DownloadRequestHandle& params, std::ostream* os) { | 12 void PrintTo(const DownloadRequestHandle& params, std::ostream* os) { |
13 } | 13 } |
14 | 14 |
15 MockDownloadManager::MockDownloadManager() {} | 15 MockDownloadManager::MockDownloadManager() {} |
16 | 16 |
17 MockDownloadManager::~MockDownloadManager() {} | 17 MockDownloadManager::~MockDownloadManager() {} |
18 | 18 |
19 DownloadItem* MockDownloadManager::StartDownload( | 19 DownloadItem* MockDownloadManager::StartDownload( |
20 scoped_ptr<DownloadCreateInfo> info, | 20 scoped_ptr<DownloadCreateInfo> info, |
21 scoped_ptr<ByteStreamReader> stream) { | 21 scoped_ptr<ByteStreamReader> stream) { |
22 return MockStartDownload(info.get(), stream.get()); | 22 return MockStartDownload(info.get(), stream.get()); |
23 } | 23 } |
24 | 24 |
| 25 DownloadItem* MockDownloadManager::CreateDownloadItem( |
| 26 const FilePath& current_path, |
| 27 const FilePath& target_path, |
| 28 const std::vector<GURL>& url_chain, |
| 29 const GURL& referrer_url, |
| 30 const base::Time& start_time, |
| 31 const base::Time& end_time, |
| 32 int64 received_bytes, |
| 33 int64 total_bytes, |
| 34 DownloadItem::DownloadState state, |
| 35 DownloadInterruptReason interrupt_reason, |
| 36 bool opened) { |
| 37 return MockCreateDownloadItem( |
| 38 target_path, url_chain, referrer_url, start_time, end_time, |
| 39 received_bytes, total_bytes, state, interrupt_reason, opened); |
| 40 } |
| 41 |
25 } // namespace content | 42 } // namespace content |
OLD | NEW |