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

Unified Diff: chrome/browser/download/base_file_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/base_file.cc ('k') | chrome/browser/download/download_file_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/download/base_file_unittest.cc
diff --git a/chrome/browser/download/base_file_unittest.cc b/chrome/browser/download/base_file_unittest.cc
index c005a1c02bfc54e64821fdc127f79d6f89fd98b0..429eb1ca5dd39b612dee7316b3e013f7d1e1a258 100644
--- a/chrome/browser/download/base_file_unittest.cc
+++ b/chrome/browser/download/base_file_unittest.cc
@@ -77,7 +77,6 @@ class BaseFileTest : public testing::Test {
// in production, where we would at least Initialize it.
TEST_F(BaseFileTest, CreateDestroy) {
EXPECT_EQ(FilePath().value(), base_file_->full_path().value());
- EXPECT_FALSE(base_file_->path_renamed());
}
// Cancel the download explicitly.
@@ -87,7 +86,6 @@ TEST_F(BaseFileTest, Cancel) {
base_file_->Cancel();
EXPECT_FALSE(file_util::PathExists(base_file_->full_path()));
EXPECT_NE(FilePath().value(), base_file_->full_path().value());
- EXPECT_FALSE(base_file_->path_renamed());
}
// Write data to the file once.
@@ -95,8 +93,6 @@ TEST_F(BaseFileTest, SingleWrite) {
ASSERT_TRUE(base_file_->Initialize(false));
AppendDataToFile(kTestData1);
base_file_->Finish();
-
- EXPECT_FALSE(base_file_->path_renamed());
}
// Write data to the file multiple times.
@@ -108,8 +104,6 @@ TEST_F(BaseFileTest, MultipleWrites) {
std::string hash;
EXPECT_FALSE(base_file_->GetSha256Hash(&hash));
base_file_->Finish();
-
- EXPECT_FALSE(base_file_->path_renamed());
}
// Write data to the file once and calculate its sha256 hash.
@@ -118,8 +112,6 @@ TEST_F(BaseFileTest, SingleWriteWithHash) {
AppendDataToFile(kTestData1);
base_file_->Finish();
- EXPECT_FALSE(base_file_->path_renamed());
-
std::string hash;
base_file_->GetSha256Hash(&hash);
EXPECT_EQ("0B2D3F3F7943AD64B860DF94D05CB56A8A97C6EC5768B5B70B930C5AA7FA9ADE",
@@ -138,7 +130,6 @@ TEST_F(BaseFileTest, MultipleWritesWithHash) {
EXPECT_FALSE(base_file_->GetSha256Hash(&hash));
base_file_->Finish();
- EXPECT_FALSE(base_file_->path_renamed());
EXPECT_TRUE(base_file_->GetSha256Hash(&hash));
EXPECT_EQ("CBF68BF10F8003DB86B31343AFAC8C7175BD03FB5FC905650F8C80AF087443A8",
base::HexEncode(hash.data(), hash.size()));
@@ -155,13 +146,11 @@ TEST_F(BaseFileTest, WriteThenRename) {
AppendDataToFile(kTestData1);
- EXPECT_TRUE(base_file_->Rename(new_path, true));
+ EXPECT_TRUE(base_file_->Rename(new_path));
EXPECT_FALSE(file_util::PathExists(initial_path));
EXPECT_TRUE(file_util::PathExists(new_path));
base_file_->Finish();
-
- EXPECT_TRUE(base_file_->path_renamed());
}
// Rename the file while the download is still in progress.
@@ -176,15 +165,13 @@ TEST_F(BaseFileTest, RenameWhileInProgress) {
AppendDataToFile(kTestData1);
EXPECT_TRUE(base_file_->in_progress());
- EXPECT_TRUE(base_file_->Rename(new_path, true));
+ EXPECT_TRUE(base_file_->Rename(new_path));
EXPECT_FALSE(file_util::PathExists(initial_path));
EXPECT_TRUE(file_util::PathExists(new_path));
AppendDataToFile(kTestData2);
base_file_->Finish();
-
- EXPECT_TRUE(base_file_->path_renamed());
}
} // namespace
« no previous file with comments | « chrome/browser/download/base_file.cc ('k') | chrome/browser/download/download_file_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698