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

Side by Side Diff: chrome/browser/download/download_manager_unittest.cc

Issue 3348010: Revert 58196 - GTTF: Clean up DownloadFileManager... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 3 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 | « chrome/browser/download/download_manager.cc ('k') | chrome/browser/download/save_file.cc » ('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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 <string> 5 #include <string>
6 6
7 #include "base/string_util.h" 7 #include "base/string_util.h"
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 #include "chrome/browser/chrome_thread.h" 9 #include "chrome/browser/chrome_thread.h"
10 #include "chrome/browser/download/download_file.h" 10 #include "chrome/browser/download/download_file.h"
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 { FILE_PATH_LITERAL("unconfirmed xxx.crdownload"), 172 { FILE_PATH_LITERAL("unconfirmed xxx.crdownload"),
173 true, 173 true,
174 false, 174 false,
175 false, 175 false,
176 1, }, 176 1, },
177 }; 177 };
178 178
179 class MockDownloadFile : public DownloadFile { 179 class MockDownloadFile : public DownloadFile {
180 public: 180 public:
181 explicit MockDownloadFile(DownloadCreateInfo* info) 181 explicit MockDownloadFile(DownloadCreateInfo* info)
182 : DownloadFile(info, NULL), renamed_count_(0) { } 182 : DownloadFile(info), renamed_count_(0) { }
183 virtual ~MockDownloadFile() { Destructed(); } 183 virtual ~MockDownloadFile() { Destructed(); }
184 MOCK_METHOD2(Rename, bool(const FilePath&, bool)); 184 MOCK_METHOD2(Rename, bool(const FilePath&, bool));
185 MOCK_METHOD0(DeleteCrDownload, void()); 185 MOCK_METHOD0(DeleteCrDownload, void());
186 MOCK_METHOD0(Destructed, void()); 186 MOCK_METHOD0(Destructed, void());
187 187
188 bool TestMultipleRename( 188 bool TestMultipleRename(
189 int expected_count, bool expected_final, const FilePath& expected, 189 int expected_count, bool expected_final, const FilePath& expected,
190 const FilePath& path, bool is_final_rename) { 190 const FilePath& path, bool is_final_rename) {
191 ++renamed_count_; 191 ++renamed_count_;
192 EXPECT_EQ(expected_count, renamed_count_); 192 EXPECT_EQ(expected_count, renamed_count_);
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 download_manager_->DownloadFinished(i, 1024); 245 download_manager_->DownloadFinished(i, 1024);
246 download_manager_->FileSelected(new_path, i, info); 246 download_manager_->FileSelected(new_path, i, info);
247 } else { 247 } else {
248 download_manager_->FileSelected(new_path, i, info); 248 download_manager_->FileSelected(new_path, i, info);
249 download_manager_->DownloadFinished(i, 1024); 249 download_manager_->DownloadFinished(i, 1024);
250 } 250 }
251 251
252 message_loop_.RunAllPending(); 252 message_loop_.RunAllPending();
253 } 253 }
254 } 254 }
OLDNEW
« no previous file with comments | « chrome/browser/download/download_manager.cc ('k') | chrome/browser/download/save_file.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698