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 <cmath> | 5 #include <cmath> |
6 #include <memory> | 6 #include <memory> |
7 #include <string> | 7 #include <string> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 NextProto protocol; | 104 NextProto protocol; |
105 SpdyNetworkTransactionTestSSLType ssl_type; | 105 SpdyNetworkTransactionTestSSLType ssl_type; |
106 bool priority_to_dependency; | 106 bool priority_to_dependency; |
107 }; | 107 }; |
108 | 108 |
109 void UpdateSpdySessionDependencies(SpdyNetworkTransactionTestParams test_params, | 109 void UpdateSpdySessionDependencies(SpdyNetworkTransactionTestParams test_params, |
110 SpdySessionDependencies* session_deps) { | 110 SpdySessionDependencies* session_deps) { |
111 session_deps->enable_alternative_service_with_different_host = true; | 111 session_deps->enable_alternative_service_with_different_host = true; |
112 if (test_params.ssl_type == HTTP_SPDY_VIA_ALT_SVC) { | 112 if (test_params.ssl_type == HTTP_SPDY_VIA_ALT_SVC) { |
113 base::Time expiration = base::Time::Now() + base::TimeDelta::FromDays(1); | 113 base::Time expiration = base::Time::Now() + base::TimeDelta::FromDays(1); |
114 session_deps->http_server_properties.SetAlternativeService( | 114 session_deps->http_server_properties->SetAlternativeService( |
115 url::SchemeHostPort("http", "www.example.org", 80), | 115 url::SchemeHostPort("http", "www.example.org", 80), |
116 AlternativeService(AlternateProtocolFromNextProto(test_params.protocol), | 116 AlternativeService(AlternateProtocolFromNextProto(test_params.protocol), |
117 "www.example.org", 443), | 117 "www.example.org", 443), |
118 expiration); | 118 expiration); |
119 } | 119 } |
120 session_deps->enable_priority_dependencies = | 120 session_deps->enable_priority_dependencies = |
121 test_params.priority_to_dependency; | 121 test_params.priority_to_dependency; |
122 } | 122 } |
123 | 123 |
124 std::unique_ptr<SpdySessionDependencies> CreateSpdySessionDependencies( | 124 std::unique_ptr<SpdySessionDependencies> CreateSpdySessionDependencies( |
(...skipping 4456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4581 arraysize(writes1)); | 4581 arraysize(writes1)); |
4582 | 4582 |
4583 std::unique_ptr<SSLSocketDataProvider> ssl_provider1( | 4583 std::unique_ptr<SSLSocketDataProvider> ssl_provider1( |
4584 new SSLSocketDataProvider(ASYNC, OK)); | 4584 new SSLSocketDataProvider(ASYNC, OK)); |
4585 // Expect only HTTP/1.1 protocol in SSLConfig. | 4585 // Expect only HTTP/1.1 protocol in SSLConfig. |
4586 ssl_provider1->next_protos_expected_in_ssl_config.push_back(kProtoHTTP11); | 4586 ssl_provider1->next_protos_expected_in_ssl_config.push_back(kProtoHTTP11); |
4587 // Force HTTP/1.1. | 4587 // Force HTTP/1.1. |
4588 ssl_provider1->SetNextProto(kProtoHTTP11); | 4588 ssl_provider1->SetNextProto(kProtoHTTP11); |
4589 helper.AddDataWithSSLSocketDataProvider(&data1, std::move(ssl_provider1)); | 4589 helper.AddDataWithSSLSocketDataProvider(&data1, std::move(ssl_provider1)); |
4590 | 4590 |
4591 base::WeakPtr<HttpServerProperties> http_server_properties = | 4591 HttpServerProperties* http_server_properties = |
4592 helper.session()->spdy_session_pool()->http_server_properties(); | 4592 helper.session()->spdy_session_pool()->http_server_properties(); |
4593 const HostPortPair host_port_pair = HostPortPair::FromURL(GURL(url)); | 4593 const HostPortPair host_port_pair = HostPortPair::FromURL(GURL(url)); |
4594 EXPECT_FALSE(http_server_properties->RequiresHTTP11(host_port_pair)); | 4594 EXPECT_FALSE(http_server_properties->RequiresHTTP11(host_port_pair)); |
4595 | 4595 |
4596 helper.RunPreTestSetup(); | 4596 helper.RunPreTestSetup(); |
4597 helper.StartDefaultTest(); | 4597 helper.StartDefaultTest(); |
4598 helper.FinishDefaultTestWithoutVerification(); | 4598 helper.FinishDefaultTestWithoutVerification(); |
4599 helper.VerifyDataConsumed(); | 4599 helper.VerifyDataConsumed(); |
4600 EXPECT_TRUE(http_server_properties->RequiresHTTP11(host_port_pair)); | 4600 EXPECT_TRUE(http_server_properties->RequiresHTTP11(host_port_pair)); |
4601 | 4601 |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4686 // Force HTTP/1.1. | 4686 // Force HTTP/1.1. |
4687 ssl_provider1->SetNextProto(kProtoHTTP11); | 4687 ssl_provider1->SetNextProto(kProtoHTTP11); |
4688 helper.AddDataWithSSLSocketDataProvider(&data1, std::move(ssl_provider1)); | 4688 helper.AddDataWithSSLSocketDataProvider(&data1, std::move(ssl_provider1)); |
4689 | 4689 |
4690 // A third socket is needed for the tunnelled connection. | 4690 // A third socket is needed for the tunnelled connection. |
4691 std::unique_ptr<SSLSocketDataProvider> ssl_provider2( | 4691 std::unique_ptr<SSLSocketDataProvider> ssl_provider2( |
4692 new SSLSocketDataProvider(ASYNC, OK)); | 4692 new SSLSocketDataProvider(ASYNC, OK)); |
4693 helper.session_deps()->socket_factory->AddSSLSocketDataProvider( | 4693 helper.session_deps()->socket_factory->AddSSLSocketDataProvider( |
4694 ssl_provider2.get()); | 4694 ssl_provider2.get()); |
4695 | 4695 |
4696 base::WeakPtr<HttpServerProperties> http_server_properties = | 4696 HttpServerProperties* http_server_properties = |
4697 helper.session()->spdy_session_pool()->http_server_properties(); | 4697 helper.session()->spdy_session_pool()->http_server_properties(); |
4698 const HostPortPair proxy_host_port_pair = HostPortPair("myproxy", 70); | 4698 const HostPortPair proxy_host_port_pair = HostPortPair("myproxy", 70); |
4699 EXPECT_FALSE(http_server_properties->RequiresHTTP11(proxy_host_port_pair)); | 4699 EXPECT_FALSE(http_server_properties->RequiresHTTP11(proxy_host_port_pair)); |
4700 | 4700 |
4701 helper.RunPreTestSetup(); | 4701 helper.RunPreTestSetup(); |
4702 helper.StartDefaultTest(); | 4702 helper.StartDefaultTest(); |
4703 helper.FinishDefaultTestWithoutVerification(); | 4703 helper.FinishDefaultTestWithoutVerification(); |
4704 helper.VerifyDataConsumed(); | 4704 helper.VerifyDataConsumed(); |
4705 EXPECT_TRUE(http_server_properties->RequiresHTTP11(proxy_host_port_pair)); | 4705 EXPECT_TRUE(http_server_properties->RequiresHTTP11(proxy_host_port_pair)); |
4706 | 4706 |
(...skipping 2550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7257 TEST_P(SpdyNetworkTransactionTLSUsageCheckTest, TLSCipherSuiteSucky) { | 7257 TEST_P(SpdyNetworkTransactionTLSUsageCheckTest, TLSCipherSuiteSucky) { |
7258 std::unique_ptr<SSLSocketDataProvider> ssl_provider( | 7258 std::unique_ptr<SSLSocketDataProvider> ssl_provider( |
7259 new SSLSocketDataProvider(ASYNC, OK)); | 7259 new SSLSocketDataProvider(ASYNC, OK)); |
7260 // Set to TLS_RSA_WITH_NULL_MD5 | 7260 // Set to TLS_RSA_WITH_NULL_MD5 |
7261 SSLConnectionStatusSetCipherSuite(0x1, &ssl_provider->connection_status); | 7261 SSLConnectionStatusSetCipherSuite(0x1, &ssl_provider->connection_status); |
7262 | 7262 |
7263 RunTLSUsageCheckTest(std::move(ssl_provider)); | 7263 RunTLSUsageCheckTest(std::move(ssl_provider)); |
7264 } | 7264 } |
7265 | 7265 |
7266 } // namespace net | 7266 } // namespace net |
OLD | NEW |