Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(194)

Side by Side Diff: net/spdy/spdy_network_transaction_unittest.cc

Issue 2041863002: Remove HttpServerProperies::GetWeakPtr(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 4455 matching lines...) Expand 10 before | Expand all | Expand 10 after
4580 arraysize(writes1)); 4580 arraysize(writes1));
4581 4581
4582 std::unique_ptr<SSLSocketDataProvider> ssl_provider1( 4582 std::unique_ptr<SSLSocketDataProvider> ssl_provider1(
4583 new SSLSocketDataProvider(ASYNC, OK)); 4583 new SSLSocketDataProvider(ASYNC, OK));
4584 // Expect only HTTP/1.1 protocol in SSLConfig. 4584 // Expect only HTTP/1.1 protocol in SSLConfig.
4585 ssl_provider1->next_protos_expected_in_ssl_config.push_back(kProtoHTTP11); 4585 ssl_provider1->next_protos_expected_in_ssl_config.push_back(kProtoHTTP11);
4586 // Force HTTP/1.1. 4586 // Force HTTP/1.1.
4587 ssl_provider1->SetNextProto(kProtoHTTP11); 4587 ssl_provider1->SetNextProto(kProtoHTTP11);
4588 helper.AddDataWithSSLSocketDataProvider(&data1, std::move(ssl_provider1)); 4588 helper.AddDataWithSSLSocketDataProvider(&data1, std::move(ssl_provider1));
4589 4589
4590 base::WeakPtr<HttpServerProperties> http_server_properties = 4590 HttpServerProperties* http_server_properties =
4591 helper.session()->spdy_session_pool()->http_server_properties(); 4591 helper.session()->spdy_session_pool()->http_server_properties();
4592 const HostPortPair host_port_pair = HostPortPair::FromURL(GURL(url)); 4592 const HostPortPair host_port_pair = HostPortPair::FromURL(GURL(url));
4593 EXPECT_FALSE(http_server_properties->RequiresHTTP11(host_port_pair)); 4593 EXPECT_FALSE(http_server_properties->RequiresHTTP11(host_port_pair));
4594 4594
4595 helper.RunPreTestSetup(); 4595 helper.RunPreTestSetup();
4596 helper.StartDefaultTest(); 4596 helper.StartDefaultTest();
4597 helper.FinishDefaultTestWithoutVerification(); 4597 helper.FinishDefaultTestWithoutVerification();
4598 helper.VerifyDataConsumed(); 4598 helper.VerifyDataConsumed();
4599 EXPECT_TRUE(http_server_properties->RequiresHTTP11(host_port_pair)); 4599 EXPECT_TRUE(http_server_properties->RequiresHTTP11(host_port_pair));
4600 4600
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
4685 // Force HTTP/1.1. 4685 // Force HTTP/1.1.
4686 ssl_provider1->SetNextProto(kProtoHTTP11); 4686 ssl_provider1->SetNextProto(kProtoHTTP11);
4687 helper.AddDataWithSSLSocketDataProvider(&data1, std::move(ssl_provider1)); 4687 helper.AddDataWithSSLSocketDataProvider(&data1, std::move(ssl_provider1));
4688 4688
4689 // A third socket is needed for the tunnelled connection. 4689 // A third socket is needed for the tunnelled connection.
4690 std::unique_ptr<SSLSocketDataProvider> ssl_provider2( 4690 std::unique_ptr<SSLSocketDataProvider> ssl_provider2(
4691 new SSLSocketDataProvider(ASYNC, OK)); 4691 new SSLSocketDataProvider(ASYNC, OK));
4692 helper.session_deps()->socket_factory->AddSSLSocketDataProvider( 4692 helper.session_deps()->socket_factory->AddSSLSocketDataProvider(
4693 ssl_provider2.get()); 4693 ssl_provider2.get());
4694 4694
4695 base::WeakPtr<HttpServerProperties> http_server_properties = 4695 HttpServerProperties* http_server_properties =
4696 helper.session()->spdy_session_pool()->http_server_properties(); 4696 helper.session()->spdy_session_pool()->http_server_properties();
4697 const HostPortPair proxy_host_port_pair = HostPortPair("myproxy", 70); 4697 const HostPortPair proxy_host_port_pair = HostPortPair("myproxy", 70);
4698 EXPECT_FALSE(http_server_properties->RequiresHTTP11(proxy_host_port_pair)); 4698 EXPECT_FALSE(http_server_properties->RequiresHTTP11(proxy_host_port_pair));
4699 4699
4700 helper.RunPreTestSetup(); 4700 helper.RunPreTestSetup();
4701 helper.StartDefaultTest(); 4701 helper.StartDefaultTest();
4702 helper.FinishDefaultTestWithoutVerification(); 4702 helper.FinishDefaultTestWithoutVerification();
4703 helper.VerifyDataConsumed(); 4703 helper.VerifyDataConsumed();
4704 EXPECT_TRUE(http_server_properties->RequiresHTTP11(proxy_host_port_pair)); 4704 EXPECT_TRUE(http_server_properties->RequiresHTTP11(proxy_host_port_pair));
4705 4705
(...skipping 2550 matching lines...) Expand 10 before | Expand all | Expand 10 after
7256 TEST_P(SpdyNetworkTransactionTLSUsageCheckTest, TLSCipherSuiteSucky) { 7256 TEST_P(SpdyNetworkTransactionTLSUsageCheckTest, TLSCipherSuiteSucky) {
7257 std::unique_ptr<SSLSocketDataProvider> ssl_provider( 7257 std::unique_ptr<SSLSocketDataProvider> ssl_provider(
7258 new SSLSocketDataProvider(ASYNC, OK)); 7258 new SSLSocketDataProvider(ASYNC, OK));
7259 // Set to TLS_RSA_WITH_NULL_MD5 7259 // Set to TLS_RSA_WITH_NULL_MD5
7260 SSLConnectionStatusSetCipherSuite(0x1, &ssl_provider->connection_status); 7260 SSLConnectionStatusSetCipherSuite(0x1, &ssl_provider->connection_status);
7261 7261
7262 RunTLSUsageCheckTest(std::move(ssl_provider)); 7262 RunTLSUsageCheckTest(std::move(ssl_provider));
7263 } 7263 }
7264 7264
7265 } // namespace net 7265 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698