summaryrefslogtreecommitdiffstats
path: root/chrome/browser/download/download_file_unittest.cc
diff options
context:
space:
mode:
authorahendrickson@chromium.org <ahendrickson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-15 15:51:44 +0000
committerahendrickson@chromium.org <ahendrickson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-15 15:51:44 +0000
commit5b1c5dfa0b6d584b9be886f8fea43191cee027c8 (patch)
tree988004d430db86d5382765ab5f021099cac7a312 /chrome/browser/download/download_file_unittest.cc
parent0a5e8fcc656dfe29af67cc7f0bb0922a4b236a19 (diff)
downloadchromium_src-5b1c5dfa0b6d584b9be886f8fea43191cee027c8.zip
chromium_src-5b1c5dfa0b6d584b9be886f8fea43191cee027c8.tar.gz
chromium_src-5b1c5dfa0b6d584b9be886f8fea43191cee027c8.tar.bz2
Refactoring DownloadFile.
Removed dead code (DeleteCrDownload method), and unnecessary parameter. BUG=None TEST=DownloadFile unit tests still pass. Review URL: http://codereview.chromium.org/6485008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@74949 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/download/download_file_unittest.cc')
-rw-r--r--chrome/browser/download/download_file_unittest.cc34
1 files changed, 0 insertions, 34 deletions
diff --git a/chrome/browser/download/download_file_unittest.cc b/chrome/browser/download/download_file_unittest.cc
index 06cd7c3..f36eaab 100644
--- a/chrome/browser/download/download_file_unittest.cc
+++ b/chrome/browser/download/download_file_unittest.cc
@@ -259,37 +259,3 @@ TEST_F(DownloadFileTest, RenameFileNoFinal) {
DestroyDownloadFile(&download_file_, 1);
}
-
-// Test that DeleteCrDownload deletes the file specified in DonloadFile, but
-// with '.crdownload' appended to the name.
-TEST_F(DownloadFileTest, DeleteCrDownload) {
- // Create and delete a temporary file, to use its file name.
- FilePath primary_path;
- EXPECT_TRUE(file_util::CreateTemporaryFileInDir(temp_dir_.path(),
- &primary_path));
- file_util::Delete(primary_path, false);
- EXPECT_FALSE(file_util::PathExists(primary_path));
-
- // Create a '.crdownload' version of the file.
- FilePath crdownload_path(download_util::GetCrDownloadPath(primary_path));
- FILE* f = file_util::OpenFile(crdownload_path, "w");
- file_util::CloseFile(f);
- EXPECT_TRUE(file_util::PathExists(crdownload_path));
-
- // Create a DownloadFile with the temp file name.
- scoped_ptr<DownloadFile> checked_file;
- CreateDownloadFile(&checked_file, 3);
-
- ASSERT_TRUE(checked_file->Initialize(false));
- EXPECT_TRUE(checked_file->Rename(primary_path, false));
- FilePath renamed_path(checked_file->full_path());
- EXPECT_TRUE(file_util::PathExists(renamed_path));
-
- // Delete the '.crdownload' version.
- EXPECT_TRUE(checked_file->DeleteCrDownload());
- EXPECT_FALSE(file_util::PathExists(crdownload_path));
-
- checked_file->Finish();
-
- DestroyDownloadFile(&checked_file, 3);
-}