summaryrefslogtreecommitdiffstats
path: root/net/http/http_network_transaction_unittest.cc
diff options
context:
space:
mode:
authorasanka@chromium.org <asanka@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-29 16:43:58 +0000
committerasanka@chromium.org <asanka@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-29 16:43:58 +0000
commitd609f284ee4b5ff4bec43858d411c135ad951285 (patch)
tree349fc2943146581c2ebd797ab2e9e47205861570 /net/http/http_network_transaction_unittest.cc
parent52bb01d16fb6427ddad5c4656c704c4a376e8267 (diff)
downloadchromium_src-d609f284ee4b5ff4bec43858d411c135ad951285.zip
chromium_src-d609f284ee4b5ff4bec43858d411c135ad951285.tar.gz
chromium_src-d609f284ee4b5ff4bec43858d411c135ad951285.tar.bz2
Revert 83524 - Re-connect if Keep-Alive connection has been closed by the time we get around to reusing it. BUG=none TEST=net_unittests --gtest_filter=HttpNetworkTransactionTest.BasicAuthKeepAliveImpatientServer:*.BasicAuthKeepAliveNoBody:*.BasicAuthKeepAliveLargeBody && unit_tests --gtest_filter=*TransportClientSocketTest.IsConnected*Review URL: http://codereview.chromium.org/6878055
TBR=asanka@chromium.org Review URL: http://codereview.chromium.org/6880318 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@83530 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http/http_network_transaction_unittest.cc')
-rw-r--r--net/http/http_network_transaction_unittest.cc31
1 files changed, 3 insertions, 28 deletions
diff --git a/net/http/http_network_transaction_unittest.cc b/net/http/http_network_transaction_unittest.cc
index e11860c..64d53ba 100644
--- a/net/http/http_network_transaction_unittest.cc
+++ b/net/http/http_network_transaction_unittest.cc
@@ -1192,18 +1192,9 @@ TEST_F(HttpNetworkTransactionTest, BasicAuthKeepAlive) {
MockRead("Hello"),
};
- // If there is a regression where we disconnect a Keep-Alive
- // connection during an auth roundtrip, we'll end up reading this.
- MockRead data_reads2[] = {
- MockRead(false, ERR_FAILED),
- };
-
StaticSocketDataProvider data1(data_reads1, arraysize(data_reads1),
data_writes1, arraysize(data_writes1));
- StaticSocketDataProvider data2(data_reads2, arraysize(data_reads2),
- NULL, 0);
session_deps.socket_factory.AddSocketDataProvider(&data1);
- session_deps.socket_factory.AddSocketDataProvider(&data2);
TestCompletionCallback callback1;
@@ -1233,7 +1224,7 @@ TEST_F(HttpNetworkTransactionTest, BasicAuthKeepAlive) {
EXPECT_EQ(OK, rv);
response = trans->GetResponseInfo();
- ASSERT_FALSE(response == NULL);
+ EXPECT_FALSE(response == NULL);
EXPECT_TRUE(response->auth_challenge.get() == NULL);
EXPECT_EQ(5, response->headers->GetContentLength());
}
@@ -1274,17 +1265,9 @@ TEST_F(HttpNetworkTransactionTest, BasicAuthKeepAliveNoBody) {
MockRead("hello"),
};
- // An incorrect reconnect would cause this to be read.
- MockRead data_reads2[] = {
- MockRead(false, ERR_FAILED),
- };
-
StaticSocketDataProvider data1(data_reads1, arraysize(data_reads1),
data_writes1, arraysize(data_writes1));
- StaticSocketDataProvider data2(data_reads2, arraysize(data_reads2),
- NULL, 0);
session_deps.socket_factory.AddSocketDataProvider(&data1);
- session_deps.socket_factory.AddSocketDataProvider(&data2);
TestCompletionCallback callback1;
@@ -1314,7 +1297,7 @@ TEST_F(HttpNetworkTransactionTest, BasicAuthKeepAliveNoBody) {
EXPECT_EQ(OK, rv);
response = trans->GetResponseInfo();
- ASSERT_FALSE(response == NULL);
+ EXPECT_FALSE(response == NULL);
EXPECT_TRUE(response->auth_challenge.get() == NULL);
EXPECT_EQ(5, response->headers->GetContentLength());
}
@@ -1363,17 +1346,9 @@ TEST_F(HttpNetworkTransactionTest, BasicAuthKeepAliveLargeBody) {
MockRead("hello"),
};
- // An incorrect reconnect would cause this to be read.
- MockRead data_reads2[] = {
- MockRead(false, ERR_FAILED),
- };
-
StaticSocketDataProvider data1(data_reads1, arraysize(data_reads1),
data_writes1, arraysize(data_writes1));
- StaticSocketDataProvider data2(data_reads2, arraysize(data_reads2),
- NULL, 0);
session_deps.socket_factory.AddSocketDataProvider(&data1);
- session_deps.socket_factory.AddSocketDataProvider(&data2);
TestCompletionCallback callback1;
@@ -1403,7 +1378,7 @@ TEST_F(HttpNetworkTransactionTest, BasicAuthKeepAliveLargeBody) {
EXPECT_EQ(OK, rv);
response = trans->GetResponseInfo();
- ASSERT_FALSE(response == NULL);
+ EXPECT_FALSE(response == NULL);
EXPECT_TRUE(response->auth_challenge.get() == NULL);
EXPECT_EQ(5, response->headers->GetContentLength());
}