Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(287)

Side by Side Diff: content/public/test/mock_download_manager.cc

Issue 23496076: WIP - Refactor programmatic downloads Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/public/test/mock_download_manager.h ('k') | net/tools/testserver/testserver.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 state == rhs.state && 75 state == rhs.state &&
76 danger_type == rhs.danger_type && 76 danger_type == rhs.danger_type &&
77 interrupt_reason == rhs.interrupt_reason && 77 interrupt_reason == rhs.interrupt_reason &&
78 opened == rhs.opened); 78 opened == rhs.opened);
79 } 79 }
80 80
81 MockDownloadManager::MockDownloadManager() {} 81 MockDownloadManager::MockDownloadManager() {}
82 82
83 MockDownloadManager::~MockDownloadManager() {} 83 MockDownloadManager::~MockDownloadManager() {}
84 84
85 void MockDownloadManager::StartDownload( 85 void MockDownloadManager::StartDownloadWithActiveRequest(
86 scoped_ptr<DownloadCreateInfo> info, 86 scoped_ptr<DownloadRequestHandle> request_handle,
87 scoped_ptr<ByteStreamReader> stream, 87 scoped_ptr<DownloadCreateInfo> info) {
88 const DownloadUrlParameters::OnStartedCallback& callback) { 88 MockStartDownload(request_handle.get(), info.get());
89 MockStartDownload(info.get(), stream.get());
90 } 89 }
91 90
92 DownloadItem* MockDownloadManager::CreateDownloadItem( 91 DownloadItem* MockDownloadManager::CreateDownloadItem(
93 uint32 id, 92 uint32 id,
94 const base::FilePath& current_path, 93 const base::FilePath& current_path,
95 const base::FilePath& target_path, 94 const base::FilePath& target_path,
96 const std::vector<GURL>& url_chain, 95 const std::vector<GURL>& url_chain,
97 const GURL& referrer_url, 96 const GURL& referrer_url,
98 const base::Time& start_time, 97 const base::Time& start_time,
99 const base::Time& end_time, 98 const base::Time& end_time,
100 const std::string& etag, 99 const std::string& etag,
101 const std::string& last_modified, 100 const std::string& last_modified,
102 int64 received_bytes, 101 int64 received_bytes,
103 int64 total_bytes, 102 int64 total_bytes,
104 DownloadItem::DownloadState state, 103 DownloadItem::DownloadState state,
105 DownloadDangerType danger_type, 104 DownloadDangerType danger_type,
106 DownloadInterruptReason interrupt_reason, 105 DownloadInterruptReason interrupt_reason,
107 bool opened) { 106 bool opened) {
108 CreateDownloadItemAdapter adapter( 107 CreateDownloadItemAdapter adapter(
109 id, current_path, target_path, url_chain, referrer_url, start_time, 108 id, current_path, target_path, url_chain, referrer_url, start_time,
110 end_time, etag, last_modified, received_bytes, total_bytes, state, 109 end_time, etag, last_modified, received_bytes, total_bytes, state,
111 danger_type, interrupt_reason, opened); 110 danger_type, interrupt_reason, opened);
112 return MockCreateDownloadItem(adapter); 111 return MockCreateDownloadItem(adapter);
113 } 112 }
114 113
115 } // namespace content 114 } // namespace content
OLDNEW
« no previous file with comments | « content/public/test/mock_download_manager.h ('k') | net/tools/testserver/testserver.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698