Index: net/http/http_proxy_client_socket_pool_unittest.cc |
=================================================================== |
--- net/http/http_proxy_client_socket_pool_unittest.cc (revision 120367) |
+++ net/http/http_proxy_client_socket_pool_unittest.cc (working copy) |
@@ -1,4 +1,4 @@ |
-// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
+// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
@@ -131,9 +131,7 @@ |
session_->http_auth_cache(), |
session_->http_auth_handler_factory(), |
session_->spdy_session_pool(), |
- tunnel, |
- base::Bind(&HttpProxyClientSocketPoolTest::OnNeedsProxyAuthCallback, |
- base::Unretained(this)))); |
+ tunnel)); |
} |
scoped_refptr<HttpProxySocketParams> GetTunnelParams() { |
@@ -193,14 +191,6 @@ |
return new HttpNetworkSession(params); |
} |
- void OnNeedsProxyAuthCallback(const HttpResponseInfo& response_info, |
- HttpAuthController* auth_controller, |
- CompletionCallback cb) { |
- // Don't add any auth, just run the callback |
- cb.Run(OK); |
- } |
- |
- |
private: |
SSLConfig ssl_config_; |
@@ -268,21 +258,9 @@ |
CreateMockWrite(*req, 0, true), |
CreateMockWrite(*rst, 2, true), |
}; |
- static const char* const kAuthChallenge[] = { |
- "status", "407 Proxy Authentication Required", |
- "version", "HTTP/1.1", |
- "proxy-authenticate", "Basic realm=\"MyRealm1\"", |
- }; |
scoped_ptr<spdy::SpdyFrame> resp( |
- ConstructSpdyControlFrame(NULL, |
- 0, |
- false, |
- 1, |
- LOWEST, |
- spdy::SYN_REPLY, |
- spdy::CONTROL_FLAG_NONE, |
- kAuthChallenge, |
- arraysize(kAuthChallenge))); |
+ ConstructSpdySynReplyError( |
+ "407 Proxy Authentication Required", NULL, 0, 1)); |
MockRead spdy_reads[] = { |
CreateMockWrite(*resp, 1, true), |
MockRead(true, 0, 3) |
@@ -299,16 +277,21 @@ |
EXPECT_FALSE(handle_.is_initialized()); |
EXPECT_FALSE(handle_.socket()); |
- data_->RunFor(GetParam() == SPDY ? 2 : 4); |
+ data_->RunFor(4); |
rv = callback_.WaitForResult(); |
- EXPECT_EQ(ERR_PROXY_AUTH_REQUESTED, rv); |
- EXPECT_TRUE(handle_.is_initialized()); |
- ASSERT_TRUE(handle_.socket()); |
if (GetParam() != SPDY) { |
+ EXPECT_EQ(ERR_PROXY_AUTH_REQUESTED, rv); |
+ EXPECT_TRUE(handle_.is_initialized()); |
+ ASSERT_TRUE(handle_.socket()); |
HttpProxyClientSocket* tunnel_socket = |
static_cast<HttpProxyClientSocket*>(handle_.socket()); |
EXPECT_FALSE(tunnel_socket->IsConnected()); |
EXPECT_FALSE(tunnel_socket->using_spdy()); |
+ } else { |
+ // Proxy auth is not really implemented for SPDY yet |
+ EXPECT_EQ(ERR_TUNNEL_CONNECTION_FAILED, rv); |
+ EXPECT_FALSE(handle_.is_initialized()); |
+ EXPECT_FALSE(handle_.socket()); |
} |
} |