| 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 <string> | 5 #include <string> |
| 6 #include <utility> | 6 #include <utility> |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 session_deps->parse_alternative_services = true; | 107 session_deps->parse_alternative_services = true; |
| 108 session_deps->enable_alternative_service_with_different_host = true; | 108 session_deps->enable_alternative_service_with_different_host = true; |
| 109 if (test_params.ssl_type == HTTP_SPDY_VIA_ALT_SVC) { | 109 if (test_params.ssl_type == HTTP_SPDY_VIA_ALT_SVC) { |
| 110 base::Time expiration = base::Time::Now() + base::TimeDelta::FromDays(1); | 110 base::Time expiration = base::Time::Now() + base::TimeDelta::FromDays(1); |
| 111 session_deps->http_server_properties.SetAlternativeService( | 111 session_deps->http_server_properties.SetAlternativeService( |
| 112 HostPortPair("www.example.org", 80), | 112 HostPortPair("www.example.org", 80), |
| 113 AlternativeService(AlternateProtocolFromNextProto(test_params.protocol), | 113 AlternativeService(AlternateProtocolFromNextProto(test_params.protocol), |
| 114 "www.example.org", 443), | 114 "www.example.org", 443), |
| 115 expiration); | 115 expiration); |
| 116 } | 116 } |
| 117 session_deps->enable_priority_dependencies = |
| 118 test_params.priority_to_dependency; |
| 117 } | 119 } |
| 118 | 120 |
| 119 scoped_ptr<SpdySessionDependencies> CreateSpdySessionDependencies( | 121 scoped_ptr<SpdySessionDependencies> CreateSpdySessionDependencies( |
| 120 SpdyNetworkTransactionTestParams test_params) { | 122 SpdyNetworkTransactionTestParams test_params) { |
| 121 scoped_ptr<SpdySessionDependencies> session_deps( | 123 scoped_ptr<SpdySessionDependencies> session_deps( |
| 122 new SpdySessionDependencies(test_params.protocol)); | 124 new SpdySessionDependencies(test_params.protocol)); |
| 123 UpdateSpdySessionDependencies(test_params, session_deps.get()); | 125 UpdateSpdySessionDependencies(test_params, session_deps.get()); |
| 124 return session_deps; | 126 return session_deps; |
| 125 } | 127 } |
| 126 | 128 |
| 127 scoped_ptr<SpdySessionDependencies> CreateSpdySessionDependencies( | 129 scoped_ptr<SpdySessionDependencies> CreateSpdySessionDependencies( |
| 128 SpdyNetworkTransactionTestParams test_params, | 130 SpdyNetworkTransactionTestParams test_params, |
| 129 scoped_ptr<ProxyService> proxy_service) { | 131 scoped_ptr<ProxyService> proxy_service) { |
| 130 scoped_ptr<SpdySessionDependencies> session_deps(new SpdySessionDependencies( | 132 scoped_ptr<SpdySessionDependencies> session_deps(new SpdySessionDependencies( |
| 131 test_params.protocol, std::move(proxy_service))); | 133 test_params.protocol, std::move(proxy_service))); |
| 132 UpdateSpdySessionDependencies(test_params, session_deps.get()); | 134 UpdateSpdySessionDependencies(test_params, session_deps.get()); |
| 133 return session_deps; | 135 return session_deps; |
| 134 } | 136 } |
| 135 | 137 |
| 136 } // namespace | 138 } // namespace |
| 137 | 139 |
| 138 class SpdyNetworkTransactionTest | 140 class SpdyNetworkTransactionTest |
| 139 : public ::testing::TestWithParam<SpdyNetworkTransactionTestParams> { | 141 : public ::testing::TestWithParam<SpdyNetworkTransactionTestParams> { |
| 140 protected: | 142 protected: |
| 141 SpdyNetworkTransactionTest() | 143 SpdyNetworkTransactionTest() |
| 142 : spdy_util_(GetParam().protocol, GetParam().priority_to_dependency) { | 144 : spdy_util_(GetParam().protocol, GetParam().priority_to_dependency) { |
| 143 SpdySession::SetPriorityDependencyDefaultForTesting( | |
| 144 GetParam().priority_to_dependency); | |
| 145 spdy_util_.set_default_url(GURL(GetDefaultUrl())); | 145 spdy_util_.set_default_url(GURL(GetDefaultUrl())); |
| 146 } | 146 } |
| 147 | 147 |
| 148 virtual ~SpdyNetworkTransactionTest() { | 148 virtual ~SpdyNetworkTransactionTest() { |
| 149 // UploadDataStream may post a deletion tasks back to the message loop on | 149 // UploadDataStream may post a deletion tasks back to the message loop on |
| 150 // destruction. | 150 // destruction. |
| 151 upload_data_stream_.reset(); | 151 upload_data_stream_.reset(); |
| 152 base::RunLoop().RunUntilIdle(); | 152 base::RunLoop().RunUntilIdle(); |
| 153 SpdySession::SetPriorityDependencyDefaultForTesting(false); | |
| 154 } | 153 } |
| 155 | 154 |
| 156 void SetUp() override { | 155 void SetUp() override { |
| 157 get_request_initialized_ = false; | 156 get_request_initialized_ = false; |
| 158 post_request_initialized_ = false; | 157 post_request_initialized_ = false; |
| 159 chunked_post_request_initialized_ = false; | 158 chunked_post_request_initialized_ = false; |
| 160 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); | 159 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
| 161 } | 160 } |
| 162 | 161 |
| 163 struct TransactionHelperResult { | 162 struct TransactionHelperResult { |
| (...skipping 6813 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6977 TEST_P(SpdyNetworkTransactionTLSUsageCheckTest, TLSCipherSuiteSucky) { | 6976 TEST_P(SpdyNetworkTransactionTLSUsageCheckTest, TLSCipherSuiteSucky) { |
| 6978 scoped_ptr<SSLSocketDataProvider> ssl_provider( | 6977 scoped_ptr<SSLSocketDataProvider> ssl_provider( |
| 6979 new SSLSocketDataProvider(ASYNC, OK)); | 6978 new SSLSocketDataProvider(ASYNC, OK)); |
| 6980 // Set to TLS_RSA_WITH_NULL_MD5 | 6979 // Set to TLS_RSA_WITH_NULL_MD5 |
| 6981 SSLConnectionStatusSetCipherSuite(0x1, &ssl_provider->connection_status); | 6980 SSLConnectionStatusSetCipherSuite(0x1, &ssl_provider->connection_status); |
| 6982 | 6981 |
| 6983 RunTLSUsageCheckTest(std::move(ssl_provider)); | 6982 RunTLSUsageCheckTest(std::move(ssl_provider)); |
| 6984 } | 6983 } |
| 6985 | 6984 |
| 6986 } // namespace net | 6985 } // namespace net |
| OLD | NEW |