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

Unified Diff: net/base/upload_file_element_reader_unittest.cc

Issue 39203004: [Net] Fix error handling on wrong file in UploadData (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 2 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: net/base/upload_file_element_reader_unittest.cc
diff --git a/net/base/upload_file_element_reader_unittest.cc b/net/base/upload_file_element_reader_unittest.cc
index b0435019e9ce7d22dd6ffb091e4fbdb7cb8f1640..0ea33ba90ca5ec485f5c5c57633db53f1b128639 100644
--- a/net/base/upload_file_element_reader_unittest.cc
+++ b/net/base/upload_file_element_reader_unittest.cc
@@ -231,7 +231,7 @@ TEST_F(UploadFileElementReaderTest, WrongPath) {
base::Time()));
TestCompletionCallback init_callback;
ASSERT_EQ(ERR_IO_PENDING, reader_->Init(init_callback.callback()));
- EXPECT_EQ(OK, init_callback.WaitForResult());
+ EXPECT_EQ(ERR_FILE_NOT_FOUND, init_callback.WaitForResult());
EXPECT_EQ(0U, reader_->GetContentLength());
EXPECT_EQ(0U, reader_->BytesRemaining());
}
@@ -366,7 +366,7 @@ TEST_F(UploadFileElementReaderSyncTest, WrongPath) {
const base::FilePath wrong_path(FILE_PATH_LITERAL("wrong_path"));
reader_.reset(new UploadFileElementReaderSync(
wrong_path, 0, kuint64max, base::Time()));
- ASSERT_EQ(OK, reader_->Init(CompletionCallback()));
+ ASSERT_EQ(ERR_FILE_NOT_FOUND, reader_->Init(CompletionCallback()));
EXPECT_EQ(0U, reader_->GetContentLength());
EXPECT_EQ(0U, reader_->BytesRemaining());
}

Powered by Google App Engine
This is Rietveld 408576698