summaryrefslogtreecommitdiffstats
path: root/net/http/http_network_transaction_unittest.cc
diff options
context:
space:
mode:
authornick@chromium.org <nick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-02 22:03:12 +0000
committernick@chromium.org <nick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-02 22:03:12 +0000
commit58a496f954596fc8720777c14213f4a35533147e (patch)
tree65b4220a7f685e08eab9a94d73629f6405e59a73 /net/http/http_network_transaction_unittest.cc
parent4d299ea9d1a3d8a582cc96bf8efb5e84f09b77d7 (diff)
downloadchromium_src-58a496f954596fc8720777c14213f4a35533147e.zip
chromium_src-58a496f954596fc8720777c14213f4a35533147e.tar.gz
chromium_src-58a496f954596fc8720777c14213f4a35533147e.tar.bz2
Revert 54405 - Fix late binding induced mismatch of Socket and AuthController
[Reason for revert: large spike in crash rate on reliability bots] ClientSocketPool treats all pending SocketParams as interchangeable. Therefore they can not contain any connection specific data. This only affects the Http Proxy tunnel case. The lowest risk change to fix this problem is to create the HttpAuthController in the HttpProxyClientSocket. If we get a 407 and need to restart the Tunnel, the pending HttpProxyClientSocket is returned to the HttpNetworkTransaction in the additional error state of the connection and then complete the auth in a pair of states in the HttpNetworkTransaction. This reintroduces a dependency between tunnel setup and the HttpNetworkTransaction, but that will need to be fixed at a later date. BUG=49493,50822 TEST=existing unit tests + manually visiting many SSL sites through a kerberized http proxy. Review URL: http://codereview.chromium.org/3058013 TBR=vandebo@chromium.org Review URL: http://codereview.chromium.org/3056040 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54616 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http/http_network_transaction_unittest.cc')
-rw-r--r--net/http/http_network_transaction_unittest.cc105
1 files changed, 0 insertions, 105 deletions
diff --git a/net/http/http_network_transaction_unittest.cc b/net/http/http_network_transaction_unittest.cc
index d6e5779..b5f614c 100644
--- a/net/http/http_network_transaction_unittest.cc
+++ b/net/http/http_network_transaction_unittest.cc
@@ -1343,111 +1343,6 @@ TEST_F(HttpNetworkTransactionTest, BasicAuthKeepAliveImpatientServer) {
EXPECT_EQ(100, response->headers->GetContentLength());
}
-// Test the request-challenge-retry sequence for basic auth, over a connection
-// that requires a restart when setting up an SSL tunnel.
-TEST_F(HttpNetworkTransactionTest, BasicAuthProxyNoKeepAlive) {
- // Configure against proxy server "myproxy:70".
- SessionDependencies session_deps(CreateFixedProxyService("myproxy:70"));
- CapturingBoundNetLog log(CapturingNetLog::kUnbounded);
- session_deps.net_log = log.bound().net_log();
- scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps));
-
- scoped_ptr<HttpTransaction> trans(new HttpNetworkTransaction(session));
-
- HttpRequestInfo request;
- request.method = "GET";
- request.url = GURL("https://www.google.com/");
- // when the no authentication data flag is set.
- request.load_flags = net::LOAD_DO_NOT_SEND_AUTH_DATA;
-
- // Since we have proxy, should try to establish tunnel.
- MockWrite data_writes1[] = {
- MockWrite("CONNECT www.google.com:443 HTTP/1.1\r\n"
- "Host: www.google.com\r\n"
- "Proxy-Connection: keep-alive\r\n\r\n"),
-
- // After calling trans->RestartWithAuth(), this is the request we should
- // be issuing -- the final header line contains the credentials.
- MockWrite("CONNECT www.google.com:443 HTTP/1.1\r\n"
- "Host: www.google.com\r\n"
- "Proxy-Connection: keep-alive\r\n"
- "Proxy-Authorization: Basic Zm9vOmJhcg==\r\n\r\n"),
-
- MockWrite("GET / HTTP/1.1\r\n"
- "Host: www.google.com\r\n"
- "Connection: keep-alive\r\n\r\n"),
- };
-
- // The proxy responds to the connect with a 407, using a persistent
- // connection.
- MockRead data_reads1[] = {
- // No credentials.
- MockRead("HTTP/1.1 407 Proxy Authentication Required\r\n"),
- MockRead("Proxy-Authenticate: Basic realm=\"MyRealm1\"\r\n"),
- MockRead("Proxy-Connection: close\r\n\r\n"),
-
- MockRead("HTTP/1.1 200 Connection Established\r\n\r\n"),
-
- MockRead("HTTP/1.1 200 OK\r\n"),
- MockRead("Content-Type: text/html; charset=iso-8859-1\r\n"),
- MockRead("Content-Length: 100\r\n\r\n"),
- MockRead(false, OK),
- };
-
- StaticSocketDataProvider data1(data_reads1, arraysize(data_reads1),
- data_writes1, arraysize(data_writes1));
- session_deps.socket_factory.AddSocketDataProvider(&data1);
- SSLSocketDataProvider ssl(true, OK);
- session_deps.socket_factory.AddSSLSocketDataProvider(&ssl);
-
- TestCompletionCallback callback1;
-
- int rv = trans->Start(&request, &callback1, log.bound());
- EXPECT_EQ(ERR_IO_PENDING, rv);
-
- rv = callback1.WaitForResult();
- EXPECT_EQ(OK, rv);
- size_t pos = ExpectLogContainsSomewhere(
- log.entries(), 0, NetLog::TYPE_HTTP_TRANSACTION_SEND_TUNNEL_HEADERS,
- NetLog::PHASE_NONE);
- ExpectLogContainsSomewhere(
- log.entries(), pos,
- NetLog::TYPE_HTTP_TRANSACTION_READ_TUNNEL_RESPONSE_HEADERS,
- NetLog::PHASE_NONE);
-
- const HttpResponseInfo* response = trans->GetResponseInfo();
- ASSERT_FALSE(response == NULL);
-
- EXPECT_EQ(407, response->headers->response_code());
- EXPECT_TRUE(HttpVersion(1, 1) == response->headers->GetHttpVersion());
-
- // The password prompt info should have been set in response->auth_challenge.
- ASSERT_FALSE(response->auth_challenge.get() == NULL);
-
- EXPECT_EQ(L"myproxy:70", response->auth_challenge->host_and_port);
- EXPECT_EQ(L"MyRealm1", response->auth_challenge->realm);
- EXPECT_EQ(L"basic", response->auth_challenge->scheme);
-
- TestCompletionCallback callback2;
-
- rv = trans->RestartWithAuth(kFoo, kBar, &callback2);
- EXPECT_EQ(ERR_IO_PENDING, rv);
-
- rv = callback2.WaitForResult();
- EXPECT_EQ(OK, rv);
-
- response = trans->GetResponseInfo();
- ASSERT_FALSE(response == NULL);
-
- EXPECT_TRUE(response->headers->IsKeepAlive());
- EXPECT_EQ(200, response->headers->response_code());
- EXPECT_EQ(100, response->headers->GetContentLength());
- EXPECT_TRUE(HttpVersion(1, 1) == response->headers->GetHttpVersion());
-
- // The password prompt info should not be set.
- EXPECT_TRUE(response->auth_challenge.get() == NULL);
-}
-
// Test the request-challenge-retry sequence for basic auth, over a keep-alive
// proxy connection, when setting up an SSL tunnel.
TEST_F(HttpNetworkTransactionTest, BasicAuthProxyKeepAlive) {