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

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

Issue 10696043: Shifted DownloadFile to exporting DownloadInterruptReasons. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync'd to TOT. Created 8 years, 6 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
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 248610c1cae469cfcf35e25d5f75cb6c2d997032..01009a89b9fe97d932f6dbf42b57f6cf9d1427ee 100644
--- a/content/browser/download/download_file_unittest.cc
+++ b/content/browser/download/download_file_unittest.cc
@@ -132,9 +132,9 @@ class DownloadFileTest : public testing::Test {
EXPECT_CALL(*input_stream_, Read(_, _))
.WillOnce(Return(content::ByteStreamReader::STREAM_EMPTY))
.RetiresOnSaturation();
- net::Error result = download_file_->Initialize();
+ content::DownloadInterruptReason result = download_file_->Initialize();
::testing::Mock::VerifyAndClearExpectations(input_stream_);
- return result == net::OK;
+ return result == content::DOWNLOAD_INTERRUPT_REASON_NONE;
}
virtual void DestroyDownloadFile(int offset) {
@@ -283,7 +283,8 @@ TEST_F(DownloadFileTest, RenameFileFinal) {
FilePath path_4(initial_path.InsertBeforeExtensionASCII("_4"));
// Rename the file before downloading any data.
- EXPECT_EQ(net::OK, download_file_->Rename(path_1));
+ EXPECT_EQ(content::DOWNLOAD_INTERRUPT_REASON_NONE,
+ download_file_->Rename(path_1));
FilePath renamed_path = download_file_->FullPath();
EXPECT_EQ(path_1, renamed_path);
@@ -296,7 +297,8 @@ TEST_F(DownloadFileTest, RenameFileFinal) {
AppendDataToFile(chunks1, 2);
// Rename the file after downloading some data.
- EXPECT_EQ(net::OK, download_file_->Rename(path_2));
+ EXPECT_EQ(content::DOWNLOAD_INTERRUPT_REASON_NONE,
+ download_file_->Rename(path_2));
renamed_path = download_file_->FullPath();
EXPECT_EQ(path_2, renamed_path);
@@ -308,7 +310,8 @@ TEST_F(DownloadFileTest, RenameFileFinal) {
AppendDataToFile(chunks2, 1);
// Rename the file after downloading all the data.
- EXPECT_EQ(net::OK, download_file_->Rename(path_3));
+ EXPECT_EQ(content::DOWNLOAD_INTERRUPT_REASON_NONE,
+ download_file_->Rename(path_3));
renamed_path = download_file_->FullPath();
EXPECT_EQ(path_3, renamed_path);
@@ -323,7 +326,8 @@ TEST_F(DownloadFileTest, RenameFileFinal) {
loop_.RunAllPending();
// Rename the file after downloading all the data and closing the file.
- EXPECT_EQ(net::OK, download_file_->Rename(path_4));
+ EXPECT_EQ(content::DOWNLOAD_INTERRUPT_REASON_NONE,
+ download_file_->Rename(path_4));
renamed_path = download_file_->FullPath();
EXPECT_EQ(path_4, renamed_path);
« no previous file with comments | « content/browser/download/download_file_manager_unittest.cc ('k') | content/browser/download/mock_download_file.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698