| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_network_transaction.h" | 5 #include "net/http/http_network_transaction.h" |
| 6 | 6 |
| 7 #include <math.h> // ceil | 7 #include <math.h> // ceil |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 8684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8695 | 8695 |
| 8696 // Now that the new handshake has failed, ensure that the client | 8696 // Now that the new handshake has failed, ensure that the client |
| 8697 // certificate was removed from the client auth cache. | 8697 // certificate was removed from the client auth cache. |
| 8698 ASSERT_FALSE(session->ssl_client_auth_cache()->Lookup("proxy:70", | 8698 ASSERT_FALSE(session->ssl_client_auth_cache()->Lookup("proxy:70", |
| 8699 &client_cert)); | 8699 &client_cert)); |
| 8700 ASSERT_FALSE(session->ssl_client_auth_cache()->Lookup("www.example.com:443", | 8700 ASSERT_FALSE(session->ssl_client_auth_cache()->Lookup("www.example.com:443", |
| 8701 &client_cert)); | 8701 &client_cert)); |
| 8702 } | 8702 } |
| 8703 } | 8703 } |
| 8704 | 8704 |
| 8705 TEST_F(HttpNetworkTransactionTest, UseIPConnectionPooling) { | 8705 TEST_F(HttpNetworkTransactionTest, DISABLED_UseIPConnectionPooling) { |
| 8706 HttpStreamFactory::set_use_alternate_protocols(true); | 8706 HttpStreamFactory::set_use_alternate_protocols(true); |
| 8707 HttpStreamFactory::set_next_protos(kExpectedNPNString); | 8707 HttpStreamFactory::set_next_protos(kExpectedNPNString); |
| 8708 | 8708 |
| 8709 // Set up a special HttpNetworkSession with a MockCachingHostResolver. | 8709 // Set up a special HttpNetworkSession with a MockCachingHostResolver. |
| 8710 SessionDependencies session_deps; | 8710 SessionDependencies session_deps; |
| 8711 MockCachingHostResolver host_resolver; | 8711 MockCachingHostResolver host_resolver; |
| 8712 net::HttpNetworkSession::Params params; | 8712 net::HttpNetworkSession::Params params; |
| 8713 params.client_socket_factory = &session_deps.socket_factory; | 8713 params.client_socket_factory = &session_deps.socket_factory; |
| 8714 params.host_resolver = &host_resolver; | 8714 params.host_resolver = &host_resolver; |
| 8715 params.cert_verifier = session_deps.cert_verifier.get(); | 8715 params.cert_verifier = session_deps.cert_verifier.get(); |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8838 virtual void RemoveObserver(Observer* observer) { | 8838 virtual void RemoveObserver(Observer* observer) { |
| 8839 return host_resolver_.RemoveObserver(observer); | 8839 return host_resolver_.RemoveObserver(observer); |
| 8840 } | 8840 } |
| 8841 | 8841 |
| 8842 private: | 8842 private: |
| 8843 MockCachingHostResolver host_resolver_; | 8843 MockCachingHostResolver host_resolver_; |
| 8844 const HostPortPair host_port_; | 8844 const HostPortPair host_port_; |
| 8845 }; | 8845 }; |
| 8846 | 8846 |
| 8847 TEST_F(HttpNetworkTransactionTest, | 8847 TEST_F(HttpNetworkTransactionTest, |
| 8848 UseIPConnectionPoolingWithHostCacheExpiration) { | 8848 DISABLED_UseIPConnectionPoolingWithHostCacheExpiration) { |
| 8849 HttpStreamFactory::set_use_alternate_protocols(true); | 8849 HttpStreamFactory::set_use_alternate_protocols(true); |
| 8850 HttpStreamFactory::set_next_protos(kExpectedNPNString); | 8850 HttpStreamFactory::set_next_protos(kExpectedNPNString); |
| 8851 | 8851 |
| 8852 // Set up a special HttpNetworkSession with a OneTimeCachingHostResolver. | 8852 // Set up a special HttpNetworkSession with a OneTimeCachingHostResolver. |
| 8853 SessionDependencies session_deps; | 8853 SessionDependencies session_deps; |
| 8854 OneTimeCachingHostResolver host_resolver(HostPortPair("www.gmail.com", 443)); | 8854 OneTimeCachingHostResolver host_resolver(HostPortPair("www.gmail.com", 443)); |
| 8855 net::HttpNetworkSession::Params params; | 8855 net::HttpNetworkSession::Params params; |
| 8856 params.client_socket_factory = &session_deps.socket_factory; | 8856 params.client_socket_factory = &session_deps.socket_factory; |
| 8857 params.host_resolver = &host_resolver; | 8857 params.host_resolver = &host_resolver; |
| 8858 params.cert_verifier = session_deps.cert_verifier.get(); | 8858 params.cert_verifier = session_deps.cert_verifier.get(); |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8939 EXPECT_TRUE(response->was_fetched_via_spdy); | 8939 EXPECT_TRUE(response->was_fetched_via_spdy); |
| 8940 EXPECT_TRUE(response->was_npn_negotiated); | 8940 EXPECT_TRUE(response->was_npn_negotiated); |
| 8941 ASSERT_EQ(OK, ReadTransaction(&trans2, &response_data)); | 8941 ASSERT_EQ(OK, ReadTransaction(&trans2, &response_data)); |
| 8942 EXPECT_EQ("hello!", response_data); | 8942 EXPECT_EQ("hello!", response_data); |
| 8943 | 8943 |
| 8944 HttpStreamFactory::set_next_protos(""); | 8944 HttpStreamFactory::set_next_protos(""); |
| 8945 HttpStreamFactory::set_use_alternate_protocols(false); | 8945 HttpStreamFactory::set_use_alternate_protocols(false); |
| 8946 } | 8946 } |
| 8947 | 8947 |
| 8948 } // namespace net | 8948 } // namespace net |
| OLD | NEW |