Index: net/http/http_proxy_client_socket_pool_unittest.cc |
diff --git a/net/http/http_proxy_client_socket_pool_unittest.cc b/net/http/http_proxy_client_socket_pool_unittest.cc |
index f2464919e3a72e53a9a3c66a76db1490d50b98f5..b7745421112332f91ac858995c6f662cd4af4e52 100644 |
--- a/net/http/http_proxy_client_socket_pool_unittest.cc |
+++ b/net/http/http_proxy_client_socket_pool_unittest.cc |
@@ -88,6 +88,11 @@ class HttpProxyClientSocketPoolTest |
BoundNetLog().net_log()), |
session_(CreateNetworkSession()), |
http_proxy_histograms_("HttpProxyUnitTest"), |
+ before_proxy_tunnel_request_callback_( |
+ base::Bind( |
+ &HttpProxyClientSocketPoolTest::OnBeforeProxyTunnelRequest, |
+ base::Unretained(this))), |
+ on_before_proxy_tunnel_request_called_(false), |
spdy_util_(GetParam().protocol), |
pool_(kMaxSockets, |
kMaxSocketsPerGroup, |
@@ -95,6 +100,7 @@ class HttpProxyClientSocketPoolTest |
NULL, |
&transport_socket_pool_, |
&ssl_socket_pool_, |
+ before_proxy_tunnel_request_callback_, |
NULL) {} |
virtual ~HttpProxyClientSocketPoolTest() { |
@@ -154,7 +160,8 @@ class HttpProxyClientSocketPoolTest |
session_->http_auth_cache(), |
session_->http_auth_handler_factory(), |
session_->spdy_session_pool(), |
- tunnel)); |
+ tunnel, |
+ before_proxy_tunnel_request_callback_)); |
} |
scoped_refptr<HttpProxySocketParams> CreateTunnelParams() { |
@@ -208,6 +215,15 @@ class HttpProxyClientSocketPoolTest |
return transport_socket_pool_.last_request_priority(); |
} |
+ void OnBeforeProxyTunnelRequest(const HostPortPair& proxy, |
+ HttpRequestHeaders* extra_headers) { |
+ on_before_proxy_tunnel_request_called_ = true; |
+ } |
+ |
+ bool on_before_proxy_tunnel_request_called() { |
+ return on_before_proxy_tunnel_request_called_; |
+ } |
+ |
private: |
SpdySessionDependencies session_deps_; |
@@ -220,6 +236,9 @@ class HttpProxyClientSocketPoolTest |
const scoped_refptr<HttpNetworkSession> session_; |
ClientSocketPoolHistograms http_proxy_histograms_; |
+ const base::Callback<void(const HostPortPair&, HttpRequestHeaders*)> |
+ before_proxy_tunnel_request_callback_; |
+ bool on_before_proxy_tunnel_request_called_; |
protected: |
SpdyTestUtil spdy_util_; |
@@ -264,6 +283,7 @@ TEST_P(HttpProxyClientSocketPoolTest, NoTunnel) { |
HttpProxyClientSocket* tunnel_socket = |
static_cast<HttpProxyClientSocket*>(handle_.socket()); |
EXPECT_TRUE(tunnel_socket->IsConnected()); |
+ EXPECT_FALSE(on_before_proxy_tunnel_request_called()); |
} |
// Make sure that HttpProxyConnectJob passes on its priority to its |
@@ -363,6 +383,7 @@ TEST_P(HttpProxyClientSocketPoolTest, HaveAuth) { |
HttpProxyClientSocket* tunnel_socket = |
static_cast<HttpProxyClientSocket*>(handle_.socket()); |
EXPECT_TRUE(tunnel_socket->IsConnected()); |
+ EXPECT_TRUE(on_before_proxy_tunnel_request_called()); |
} |
TEST_P(HttpProxyClientSocketPoolTest, AsyncHaveAuth) { |