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

Unified Diff: net/ftp/ftp_network_transaction_unittest.cc

Issue 197050: Return ERR_FILE_NOT_FOUND from FtpNetworkTransaction when we can. (Closed)
Patch Set: clarify Created 11 years, 3 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
« net/ftp/ftp_network_transaction.cc ('K') | « net/ftp/ftp_network_transaction.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/ftp/ftp_network_transaction_unittest.cc
diff --git a/net/ftp/ftp_network_transaction_unittest.cc b/net/ftp/ftp_network_transaction_unittest.cc
index caf08f508c976399ebbe8677043c95b1b74206a4..b3603c0088a01800c1c85ca8f89eea15841d7e77 100644
--- a/net/ftp/ftp_network_transaction_unittest.cc
+++ b/net/ftp/ftp_network_transaction_unittest.cc
@@ -303,7 +303,7 @@ class FtpMockControlSocketFileDownloadRetrFail
"227 Entering Passive Mode (127,0,0,1,123,456)\r\n");
case PRE_CWD:
return Verify("CWD /file\r\n", data, PRE_QUIT,
- "500 file is a directory\r\n");
+ "550 file is a directory\r\n");
default:
return FtpMockControlSocketFileDownload::OnWrite(data);
}
@@ -684,6 +684,16 @@ TEST_F(FtpNetworkTransactionTest, DirectoryTransactionFailCwd) {
ERR_FAILED);
}
+TEST_F(FtpNetworkTransactionTest, DirectoryTransactionFileNotFound) {
+ FtpMockControlSocketDirectoryListing ctrl_socket;
+ TransactionFailHelper(&ctrl_socket,
+ "ftp://host",
+ FtpMockControlSocket::PRE_CWD,
+ FtpMockControlSocket::PRE_QUIT,
+ "550 cannot open file\r\n",
+ ERR_FILE_NOT_FOUND);
+}
+
TEST_F(FtpNetworkTransactionTest, DirectoryTransactionFailList) {
FtpMockControlSocketDirectoryListing ctrl_socket;
TransactionFailHelper(&ctrl_socket,
@@ -769,9 +779,19 @@ TEST_F(FtpNetworkTransactionTest, DownloadTransactionFailRetr) {
TransactionFailHelper(&ctrl_socket,
"ftp://host/file",
FtpMockControlSocket::PRE_RETR,
- FtpMockControlSocket::PRE_PASV2,
+ FtpMockControlSocket::PRE_QUIT,
"500 failed retr\r\n",
ERR_FAILED);
}
+TEST_F(FtpNetworkTransactionTest, DownloadTransactionFileNotFound) {
+ FtpMockControlSocketFileDownloadRetrFail ctrl_socket;
+ TransactionFailHelper(&ctrl_socket,
+ "ftp://host/file",
+ FtpMockControlSocket::PRE_RETR,
+ FtpMockControlSocket::PRE_PASV2,
+ "550 cannot open file\r\n",
+ ERR_FILE_NOT_FOUND);
+}
+
} // namespace net
« net/ftp/ftp_network_transaction.cc ('K') | « net/ftp/ftp_network_transaction.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698