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

Unified Diff: content/browser/download/download_file_unittest.cc

Issue 8372034: Created an interface for DownloadFile, for use in unit tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed typo Created 9 years, 1 month 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
Index: content/browser/download/download_file_unittest.cc
diff --git a/content/browser/download/download_file_unittest.cc b/content/browser/download/download_file_unittest.cc
index 00911250e532bdd10cd08255ba156dd9f96df081..2fcb51cde5f481cd3074d32a5cc7d1829a06e02f 100644
--- a/content/browser/download/download_file_unittest.cc
+++ b/content/browser/download/download_file_unittest.cc
@@ -7,7 +7,7 @@
#include "base/string_number_conversions.h"
#include "content/browser/browser_thread_impl.h"
#include "content/browser/download/download_create_info.h"
-#include "content/browser/download/download_file.h"
+#include "content/browser/download/download_file_impl.h"
#include "content/browser/download/download_id.h"
#include "content/browser/download/download_id_factory.h"
#include "content/browser/download/download_manager.h"
@@ -72,20 +72,20 @@ class DownloadFileTest : public testing::Test {
// info.request_handle default constructed to null.
info.save_info.file_stream = file_stream_;
file->reset(
- new DownloadFile(&info, new DownloadRequestHandle(),
- download_manager_));
+ new DownloadFileImpl(&info, new DownloadRequestHandle(),
+ download_manager_));
}
virtual void DestroyDownloadFile(scoped_ptr<DownloadFile>* file, int offset) {
- EXPECT_EQ(kDummyDownloadId + offset, (*file)->id());
+ EXPECT_EQ(kDummyDownloadId + offset, (*file)->Id());
EXPECT_EQ(download_manager_, (*file)->GetDownloadManager());
- EXPECT_FALSE((*file)->in_progress());
+ EXPECT_FALSE((*file)->InProgress());
EXPECT_EQ(static_cast<int64>(expected_data_.size()),
- (*file)->bytes_so_far());
+ (*file)->BytesSoFar());
// Make sure the data has been properly written to disk.
std::string disk_data;
- EXPECT_TRUE(file_util::ReadFileToString((*file)->full_path(),
+ EXPECT_TRUE(file_util::ReadFileToString((*file)->FullPath(),
&disk_data));
EXPECT_EQ(expected_data_, disk_data);
@@ -96,11 +96,11 @@ class DownloadFileTest : public testing::Test {
void AppendDataToFile(scoped_ptr<DownloadFile>* file,
const std::string& data) {
- EXPECT_TRUE((*file)->in_progress());
+ EXPECT_TRUE((*file)->InProgress());
(*file)->AppendDataToFile(data.data(), data.size());
expected_data_ += data;
EXPECT_EQ(static_cast<int64>(expected_data_.size()),
- (*file)->bytes_so_far());
+ (*file)->BytesSoFar());
}
protected:
@@ -141,7 +141,7 @@ const int DownloadFileTest::kDummyRequestId = 67;
TEST_F(DownloadFileTest, RenameFileFinal) {
CreateDownloadFile(&download_file_, 0);
ASSERT_EQ(net::OK, download_file_->Initialize(true));
- FilePath initial_path(download_file_->full_path());
+ FilePath initial_path(download_file_->FullPath());
EXPECT_TRUE(file_util::PathExists(initial_path));
FilePath path_1(initial_path.InsertBeforeExtensionASCII("_1"));
FilePath path_2(initial_path.InsertBeforeExtensionASCII("_2"));
@@ -150,7 +150,7 @@ TEST_F(DownloadFileTest, RenameFileFinal) {
// Rename the file before downloading any data.
EXPECT_EQ(net::OK, download_file_->Rename(path_1));
- FilePath renamed_path = download_file_->full_path();
+ FilePath renamed_path = download_file_->FullPath();
EXPECT_EQ(path_1, renamed_path);
// Check the files.
@@ -163,7 +163,7 @@ TEST_F(DownloadFileTest, RenameFileFinal) {
// Rename the file after downloading some data.
EXPECT_EQ(net::OK, download_file_->Rename(path_2));
- renamed_path = download_file_->full_path();
+ renamed_path = download_file_->FullPath();
EXPECT_EQ(path_2, renamed_path);
// Check the files.
@@ -174,7 +174,7 @@ TEST_F(DownloadFileTest, RenameFileFinal) {
// Rename the file after downloading all the data.
EXPECT_EQ(net::OK, download_file_->Rename(path_3));
- renamed_path = download_file_->full_path();
+ renamed_path = download_file_->FullPath();
EXPECT_EQ(path_3, renamed_path);
// Check the files.
@@ -189,7 +189,7 @@ TEST_F(DownloadFileTest, RenameFileFinal) {
// Rename the file after downloading all the data and closing the file.
EXPECT_EQ(net::OK, download_file_->Rename(path_4));
- renamed_path = download_file_->full_path();
+ renamed_path = download_file_->FullPath();
EXPECT_EQ(path_4, renamed_path);
// Check the files.

Powered by Google App Engine
This is Rietveld 408576698