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

Unified Diff: chrome/browser/download/download_manager_unittest.cc

Issue 6480079: DownloadFile no longer keeps track of whether or not the final rename has occurred. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed nits. Created 9 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/download/download_file_unittest.cc ('k') | chrome/browser/download/save_file_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/download/download_manager_unittest.cc
diff --git a/chrome/browser/download/download_manager_unittest.cc b/chrome/browser/download/download_manager_unittest.cc
index 28c56f78bb63286e39544906244d46a84ebacf5b..f9f5f4d017388bb73324a8833368876814f4c26a 100644
--- a/chrome/browser/download/download_manager_unittest.cc
+++ b/chrome/browser/download/download_manager_unittest.cc
@@ -178,15 +178,14 @@ class MockDownloadFile : public DownloadFile {
explicit MockDownloadFile(DownloadCreateInfo* info)
: DownloadFile(info, NULL), renamed_count_(0) { }
virtual ~MockDownloadFile() { Destructed(); }
- MOCK_METHOD2(Rename, bool(const FilePath&, bool));
+ MOCK_METHOD1(Rename, bool(const FilePath&));
MOCK_METHOD0(Destructed, void());
bool TestMultipleRename(
- int expected_count, bool expected_final, const FilePath& expected,
- const FilePath& path, bool is_final_rename) {
+ int expected_count, const FilePath& expected,
+ const FilePath& path) {
++renamed_count_;
EXPECT_EQ(expected_count, renamed_count_);
- EXPECT_EQ(expected_final, is_final_rename);
EXPECT_EQ(expected.value(), path.value());
return true;
}
@@ -221,19 +220,18 @@ TEST_F(DownloadManagerTest, DownloadRenameTest) {
EXPECT_CALL(*download, Destructed()).Times(1);
if (kDownloadRenameCases[i].expected_rename_count == 1) {
- EXPECT_CALL(*download, Rename(new_path, true)).WillOnce(Return(true));
+ EXPECT_CALL(*download, Rename(new_path)).WillOnce(Return(true));
} else {
ASSERT_EQ(2, kDownloadRenameCases[i].expected_rename_count);
FilePath crdownload(download_util::GetCrDownloadPath(new_path));
- EXPECT_CALL(*download, Rename(_, _))
- .WillOnce(testing::WithArgs<0, 1>(Invoke(CreateFunctor(
+ EXPECT_CALL(*download, Rename(_))
+ .WillOnce(testing::WithArgs<0>(Invoke(CreateFunctor(
download, &MockDownloadFile::TestMultipleRename,
- 1, false, crdownload))))
- .WillOnce(testing::WithArgs<0, 1>(Invoke(CreateFunctor(
+ 1, crdownload))))
+ .WillOnce(testing::WithArgs<0>(Invoke(CreateFunctor(
download, &MockDownloadFile::TestMultipleRename,
- 2, true, new_path))));
+ 2, new_path))));
}
-
download_manager_->CreateDownloadItem(info);
if (kDownloadRenameCases[i].finish_before_rename) {
« no previous file with comments | « chrome/browser/download/download_file_unittest.cc ('k') | chrome/browser/download/save_file_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698