| 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 { |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 interrupt_reason == rhs.interrupt_reason && | 71 interrupt_reason == rhs.interrupt_reason && |
| 72 opened == rhs.opened); | 72 opened == rhs.opened); |
| 73 } | 73 } |
| 74 | 74 |
| 75 MockDownloadManager::MockDownloadManager() {} | 75 MockDownloadManager::MockDownloadManager() {} |
| 76 | 76 |
| 77 MockDownloadManager::~MockDownloadManager() {} | 77 MockDownloadManager::~MockDownloadManager() {} |
| 78 | 78 |
| 79 void MockDownloadManager::StartDownload( | 79 void MockDownloadManager::StartDownload( |
| 80 scoped_ptr<DownloadCreateInfo> info, | 80 scoped_ptr<DownloadCreateInfo> info, |
| 81 scoped_ptr<ByteStreamReader> stream, | 81 scoped_ptr<ByteStreamReader<DownloadInterruptReason> > stream, |
| 82 const DownloadUrlParameters::OnStartedCallback& callback) { | 82 const DownloadUrlParameters::OnStartedCallback& callback) { |
| 83 MockStartDownload(info.get(), stream.get()); | 83 MockStartDownload(info.get(), stream.get()); |
| 84 } | 84 } |
| 85 | 85 |
| 86 DownloadItem* MockDownloadManager::CreateDownloadItem( | 86 DownloadItem* MockDownloadManager::CreateDownloadItem( |
| 87 uint32 id, | 87 uint32 id, |
| 88 const base::FilePath& current_path, | 88 const base::FilePath& current_path, |
| 89 const base::FilePath& target_path, | 89 const base::FilePath& target_path, |
| 90 const std::vector<GURL>& url_chain, | 90 const std::vector<GURL>& url_chain, |
| 91 const GURL& referrer_url, | 91 const GURL& referrer_url, |
| 92 const base::Time& start_time, | 92 const base::Time& start_time, |
| 93 const base::Time& end_time, | 93 const base::Time& end_time, |
| 94 int64 received_bytes, | 94 int64 received_bytes, |
| 95 int64 total_bytes, | 95 int64 total_bytes, |
| 96 DownloadItem::DownloadState state, | 96 DownloadItem::DownloadState state, |
| 97 DownloadDangerType danger_type, | 97 DownloadDangerType danger_type, |
| 98 DownloadInterruptReason interrupt_reason, | 98 DownloadInterruptReason interrupt_reason, |
| 99 bool opened) { | 99 bool opened) { |
| 100 CreateDownloadItemAdapter adapter( | 100 CreateDownloadItemAdapter adapter( |
| 101 id, current_path, target_path, url_chain, referrer_url, start_time, | 101 id, current_path, target_path, url_chain, referrer_url, start_time, |
| 102 end_time, received_bytes, total_bytes, state, danger_type, | 102 end_time, received_bytes, total_bytes, state, danger_type, |
| 103 interrupt_reason, opened); | 103 interrupt_reason, opened); |
| 104 return MockCreateDownloadItem(adapter); | 104 return MockCreateDownloadItem(adapter); |
| 105 } | 105 } |
| 106 | 106 |
| 107 } // namespace content | 107 } // namespace content |
| OLD | NEW |