OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "net/http/http_proxy_client_socket_pool.h" | 5 #include "net/http/http_proxy_client_socket_pool.h" |
6 | 6 |
7 #include "base/callback.h" | 7 #include "base/callback.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 InitializeSpdySsl(); | 280 InitializeSpdySsl(); |
281 } | 281 } |
282 socket_factory()->AddSSLSocketDataProvider(ssl_data_.get()); | 282 socket_factory()->AddSSLSocketDataProvider(ssl_data_.get()); |
283 } | 283 } |
284 } | 284 } |
285 | 285 |
286 void InitializeSpdySsl() { | 286 void InitializeSpdySsl() { |
287 ssl_data_->SetNextProto(GetParam().protocol); | 287 ssl_data_->SetNextProto(GetParam().protocol); |
288 } | 288 } |
289 | 289 |
290 scoped_ptr<HttpNetworkSession> CreateNetworkSession() { | 290 HttpNetworkSession* CreateNetworkSession() { |
291 return SpdySessionDependencies::SpdyCreateSession(&session_deps_); | 291 return SpdySessionDependencies::SpdyCreateSession(&session_deps_); |
292 } | 292 } |
293 | 293 |
294 RequestPriority GetLastTransportRequestPriority() const { | 294 RequestPriority GetLastTransportRequestPriority() const { |
295 return transport_socket_pool_.last_request_priority(); | 295 return transport_socket_pool_.last_request_priority(); |
296 } | 296 } |
297 | 297 |
298 private: | 298 private: |
299 SpdySessionDependencies session_deps_; | 299 SpdySessionDependencies session_deps_; |
300 | 300 |
301 MockTransportClientSocketPool transport_socket_pool_; | 301 MockTransportClientSocketPool transport_socket_pool_; |
302 MockHostResolver host_resolver_; | 302 MockHostResolver host_resolver_; |
303 scoped_ptr<CertVerifier> cert_verifier_; | 303 scoped_ptr<CertVerifier> cert_verifier_; |
304 SSLClientSocketPool ssl_socket_pool_; | 304 SSLClientSocketPool ssl_socket_pool_; |
305 | 305 |
306 const scoped_ptr<HttpNetworkSession> session_; | 306 const scoped_refptr<HttpNetworkSession> session_; |
307 | 307 |
308 protected: | 308 protected: |
309 SpdyTestUtil spdy_util_; | 309 SpdyTestUtil spdy_util_; |
310 scoped_ptr<SSLSocketDataProvider> ssl_data_; | 310 scoped_ptr<SSLSocketDataProvider> ssl_data_; |
311 scoped_ptr<SequencedSocketData> data_; | 311 scoped_ptr<SequencedSocketData> data_; |
312 HttpProxyClientSocketPool pool_; | 312 HttpProxyClientSocketPool pool_; |
313 ClientSocketHandle handle_; | 313 ClientSocketHandle handle_; |
314 TestCompletionCallback callback_; | 314 TestCompletionCallback callback_; |
315 }; | 315 }; |
316 | 316 |
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
812 EXPECT_TRUE(headers->IsRedirect(&location)); | 812 EXPECT_TRUE(headers->IsRedirect(&location)); |
813 EXPECT_EQ(location, redirectTarget); | 813 EXPECT_EQ(location, redirectTarget); |
814 } | 814 } |
815 } | 815 } |
816 | 816 |
817 // It would be nice to also test the timeouts in HttpProxyClientSocketPool. | 817 // It would be nice to also test the timeouts in HttpProxyClientSocketPool. |
818 | 818 |
819 } // namespace | 819 } // namespace |
820 | 820 |
821 } // namespace net | 821 } // namespace net |
OLD | NEW |