| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <memory> | 5 #include <memory> |
| 6 #include <ostream> | 6 #include <ostream> |
| 7 #include <utility> | 7 #include <utility> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "base/memory/ptr_util.h" | 11 #include "base/memory/ptr_util.h" |
| 12 #include "base/stl_util.h" | 12 #include "base/stl_util.h" |
| 13 #include "base/strings/string_number_conversions.h" | 13 #include "base/strings/string_number_conversions.h" |
| 14 #include "net/base/elements_upload_data_stream.h" | 14 #include "net/base/elements_upload_data_stream.h" |
| 15 #include "net/base/ip_address.h" | 15 #include "net/base/ip_address.h" |
| 16 #include "net/base/test_completion_callback.h" | 16 #include "net/base/test_completion_callback.h" |
| 17 #include "net/base/test_data_directory.h" | 17 #include "net/base/test_data_directory.h" |
| 18 #include "net/base/upload_bytes_element_reader.h" | 18 #include "net/base/upload_bytes_element_reader.h" |
| 19 #include "net/base/upload_data_stream.h" | 19 #include "net/base/upload_data_stream.h" |
| 20 #include "net/cert/ct_policy_enforcer.h" |
| 20 #include "net/cert/mock_cert_verifier.h" | 21 #include "net/cert/mock_cert_verifier.h" |
| 21 #include "net/cert/multi_log_ct_verifier.h" | 22 #include "net/cert/multi_log_ct_verifier.h" |
| 22 #include "net/dns/mapped_host_resolver.h" | 23 #include "net/dns/mapped_host_resolver.h" |
| 23 #include "net/dns/mock_host_resolver.h" | 24 #include "net/dns/mock_host_resolver.h" |
| 24 #include "net/http/http_auth_handler_factory.h" | 25 #include "net/http/http_auth_handler_factory.h" |
| 25 #include "net/http/http_network_session.h" | 26 #include "net/http/http_network_session.h" |
| 26 #include "net/http/http_network_transaction.h" | 27 #include "net/http/http_network_transaction.h" |
| 27 #include "net/http/http_server_properties_impl.h" | 28 #include "net/http/http_server_properties_impl.h" |
| 28 #include "net/http/http_transaction_test_util.h" | 29 #include "net/http/http_transaction_test_util.h" |
| 29 #include "net/http/transport_security_state.h" | 30 #include "net/http/transport_security_state.h" |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 params_.enable_quic = true; | 112 params_.enable_quic = true; |
| 112 params_.quic_clock = nullptr; | 113 params_.quic_clock = nullptr; |
| 113 params_.quic_random = nullptr; | 114 params_.quic_random = nullptr; |
| 114 if (GetParam().use_stateless_rejects) { | 115 if (GetParam().use_stateless_rejects) { |
| 115 params_.quic_connection_options.push_back(kSREJ); | 116 params_.quic_connection_options.push_back(kSREJ); |
| 116 } | 117 } |
| 117 params_.host_resolver = &host_resolver_; | 118 params_.host_resolver = &host_resolver_; |
| 118 params_.cert_verifier = &cert_verifier_; | 119 params_.cert_verifier = &cert_verifier_; |
| 119 params_.transport_security_state = &transport_security_state_; | 120 params_.transport_security_state = &transport_security_state_; |
| 120 params_.cert_transparency_verifier = cert_transparency_verifier_.get(); | 121 params_.cert_transparency_verifier = cert_transparency_verifier_.get(); |
| 122 params_.ct_policy_enforcer = &ct_policy_enforcer_; |
| 121 params_.proxy_service = proxy_service_.get(); | 123 params_.proxy_service = proxy_service_.get(); |
| 122 params_.ssl_config_service = ssl_config_service_.get(); | 124 params_.ssl_config_service = ssl_config_service_.get(); |
| 123 params_.http_auth_handler_factory = auth_handler_factory_.get(); | 125 params_.http_auth_handler_factory = auth_handler_factory_.get(); |
| 124 params_.http_server_properties = &http_server_properties_; | 126 params_.http_server_properties = &http_server_properties_; |
| 125 channel_id_service_.reset( | 127 channel_id_service_.reset( |
| 126 new ChannelIDService(new DefaultChannelIDStore(nullptr), | 128 new ChannelIDService(new DefaultChannelIDStore(nullptr), |
| 127 base::ThreadTaskRunnerHandle::Get())); | 129 base::ThreadTaskRunnerHandle::Get())); |
| 128 params_.channel_id_service = channel_id_service_.get(); | 130 params_.channel_id_service = channel_id_service_.get(); |
| 129 | 131 |
| 130 CertVerifyResult verify_result; | 132 CertVerifyResult verify_result; |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 EXPECT_EQ(status_line, consumer.response_info()->headers->GetStatusLine()); | 246 EXPECT_EQ(status_line, consumer.response_info()->headers->GetStatusLine()); |
| 245 EXPECT_EQ(body, consumer.content()); | 247 EXPECT_EQ(body, consumer.content()); |
| 246 } | 248 } |
| 247 | 249 |
| 248 std::unique_ptr<MockHostResolver> host_resolver_impl_; | 250 std::unique_ptr<MockHostResolver> host_resolver_impl_; |
| 249 MappedHostResolver host_resolver_; | 251 MappedHostResolver host_resolver_; |
| 250 MockCertVerifier cert_verifier_; | 252 MockCertVerifier cert_verifier_; |
| 251 std::unique_ptr<ChannelIDService> channel_id_service_; | 253 std::unique_ptr<ChannelIDService> channel_id_service_; |
| 252 TransportSecurityState transport_security_state_; | 254 TransportSecurityState transport_security_state_; |
| 253 std::unique_ptr<CTVerifier> cert_transparency_verifier_; | 255 std::unique_ptr<CTVerifier> cert_transparency_verifier_; |
| 256 CTPolicyEnforcer ct_policy_enforcer_; |
| 254 scoped_refptr<SSLConfigServiceDefaults> ssl_config_service_; | 257 scoped_refptr<SSLConfigServiceDefaults> ssl_config_service_; |
| 255 std::unique_ptr<ProxyService> proxy_service_; | 258 std::unique_ptr<ProxyService> proxy_service_; |
| 256 std::unique_ptr<HttpAuthHandlerFactory> auth_handler_factory_; | 259 std::unique_ptr<HttpAuthHandlerFactory> auth_handler_factory_; |
| 257 HttpServerPropertiesImpl http_server_properties_; | 260 HttpServerPropertiesImpl http_server_properties_; |
| 258 HttpNetworkSession::Params params_; | 261 HttpNetworkSession::Params params_; |
| 259 std::unique_ptr<TestTransactionFactory> transaction_factory_; | 262 std::unique_ptr<TestTransactionFactory> transaction_factory_; |
| 260 HttpRequestInfo request_; | 263 HttpRequestInfo request_; |
| 261 std::string request_body_; | 264 std::string request_body_; |
| 262 std::unique_ptr<UploadDataStream> upload_data_stream_; | 265 std::unique_ptr<UploadDataStream> upload_data_stream_; |
| 263 std::unique_ptr<ServerThread> server_thread_; | 266 std::unique_ptr<ServerThread> server_thread_; |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 base::MessageLoop::current()->Run(); | 377 base::MessageLoop::current()->Run(); |
| 375 | 378 |
| 376 for (size_t i = 0; i < num_requests; ++i) { | 379 for (size_t i = 0; i < num_requests; ++i) { |
| 377 CheckResponse(*consumers[i], "HTTP/1.1 200", kResponseBody); | 380 CheckResponse(*consumers[i], "HTTP/1.1 200", kResponseBody); |
| 378 } | 381 } |
| 379 STLDeleteElements(&consumers); | 382 STLDeleteElements(&consumers); |
| 380 } | 383 } |
| 381 | 384 |
| 382 } // namespace test | 385 } // namespace test |
| 383 } // namespace net | 386 } // namespace net |
| OLD | NEW |