summaryrefslogtreecommitdiffstats
path: root/net/ftp/ftp_network_transaction_unittest.cc
diff options
context:
space:
mode:
authorphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-12 19:19:28 +0000
committerphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-12 19:19:28 +0000
commitbf5ad689ec6a922a8b8815fcf6223f2b3a22f025 (patch)
tree632b06b957cb15ee571cedfbdb9885815ee5cd98 /net/ftp/ftp_network_transaction_unittest.cc
parent704dd3637a9e986f4636302c3ce11700fbdba4ab (diff)
downloadchromium_src-bf5ad689ec6a922a8b8815fcf6223f2b3a22f025.zip
chromium_src-bf5ad689ec6a922a8b8815fcf6223f2b3a22f025.tar.gz
chromium_src-bf5ad689ec6a922a8b8815fcf6223f2b3a22f025.tar.bz2
Make FtpNetworkTransaction report its load state.
TEST=Covered by net_unittests. http://crbug.com/19095 Review URL: http://codereview.chromium.org/164354 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23201 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/ftp/ftp_network_transaction_unittest.cc')
-rw-r--r--net/ftp/ftp_network_transaction_unittest.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/net/ftp/ftp_network_transaction_unittest.cc b/net/ftp/ftp_network_transaction_unittest.cc
index 10c77a3..9ee5d50 100644
--- a/net/ftp/ftp_network_transaction_unittest.cc
+++ b/net/ftp/ftp_network_transaction_unittest.cc
@@ -309,8 +309,10 @@ class FtpNetworkTransactionTest : public PlatformTest {
mock_socket_factory_.AddMockSocket(&data_socket1);
mock_socket_factory_.AddMockSocket(&data_socket2);
FtpRequestInfo request_info = GetRequestInfo(request);
+ EXPECT_EQ(LOAD_STATE_IDLE, transaction_.GetLoadState());
ASSERT_EQ(ERR_IO_PENDING,
transaction_.Start(NULL, &request_info, &callback_));
+ EXPECT_NE(LOAD_STATE_IDLE, transaction_.GetLoadState());
EXPECT_EQ(expected_result, callback_.WaitForResult());
EXPECT_EQ(FtpMockControlSocket::QUIT, ctrl_socket->state());
if (expected_result == OK) {
@@ -322,6 +324,7 @@ class FtpNetworkTransactionTest : public PlatformTest {
callback_.WaitForResult());
EXPECT_EQ(mock_data, std::string(io_buffer->data(), mock_data.length()));
}
+ EXPECT_EQ(LOAD_STATE_IDLE, transaction_.GetLoadState());
}
void TransactionFailHelper(FtpMockControlSocket* ctrl_socket,
@@ -344,9 +347,11 @@ class FtpNetworkTransactionTest : public PlatformTest {
TEST_F(FtpNetworkTransactionTest, FailedLookup) {
FtpRequestInfo request_info = GetRequestInfo("ftp://badhost");
host_resolver_->rules()->AddSimulatedFailure("badhost");
+ EXPECT_EQ(LOAD_STATE_IDLE, transaction_.GetLoadState());
ASSERT_EQ(ERR_IO_PENDING,
transaction_.Start(NULL, &request_info, &callback_));
EXPECT_EQ(ERR_NAME_NOT_RESOLVED, callback_.WaitForResult());
+ EXPECT_EQ(LOAD_STATE_IDLE, transaction_.GetLoadState());
}
TEST_F(FtpNetworkTransactionTest, DirectoryTransaction) {