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 "net/url_request/url_request_test_util.h" | 5 #include "net/url_request/url_request_test_util.h" |
6 | 6 |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/threading/thread.h" | 10 #include "base/threading/thread.h" |
| 11 #include "net/base/cert_verifier.h" |
11 #include "net/base/default_origin_bound_cert_store.h" | 12 #include "net/base/default_origin_bound_cert_store.h" |
12 #include "net/base/host_port_pair.h" | 13 #include "net/base/host_port_pair.h" |
13 #include "net/base/origin_bound_cert_service.h" | 14 #include "net/base/origin_bound_cert_service.h" |
14 #include "net/http/http_network_session.h" | 15 #include "net/http/http_network_session.h" |
15 #include "net/http/http_server_properties_impl.h" | 16 #include "net/http/http_server_properties_impl.h" |
16 #include "net/url_request/url_request_job_factory.h" | 17 #include "net/url_request/url_request_job_factory.h" |
17 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
18 | 19 |
19 namespace { | 20 namespace { |
20 | 21 |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 } | 105 } |
105 | 106 |
106 TestURLRequestContext::~TestURLRequestContext() { | 107 TestURLRequestContext::~TestURLRequestContext() { |
107 DCHECK(initialized_); | 108 DCHECK(initialized_); |
108 } | 109 } |
109 | 110 |
110 void TestURLRequestContext::Init() { | 111 void TestURLRequestContext::Init() { |
111 DCHECK(!initialized_); | 112 DCHECK(!initialized_); |
112 initialized_ = true; | 113 initialized_ = true; |
113 if (!cert_verifier()) | 114 if (!cert_verifier()) |
114 context_storage_.set_cert_verifier(new net::CertVerifier); | 115 context_storage_.set_cert_verifier(net::CertVerifier::CreateDefault()); |
115 if (!ftp_transaction_factory()) { | 116 if (!ftp_transaction_factory()) { |
116 context_storage_.set_ftp_transaction_factory( | 117 context_storage_.set_ftp_transaction_factory( |
117 new net::FtpNetworkLayer(host_resolver())); | 118 new net::FtpNetworkLayer(host_resolver())); |
118 } | 119 } |
119 if (!ssl_config_service()) | 120 if (!ssl_config_service()) |
120 context_storage_.set_ssl_config_service(new net::SSLConfigServiceDefaults); | 121 context_storage_.set_ssl_config_service(new net::SSLConfigServiceDefaults); |
121 if (!http_auth_handler_factory()) { | 122 if (!http_auth_handler_factory()) { |
122 context_storage_.set_http_auth_handler_factory( | 123 context_storage_.set_http_auth_handler_factory( |
123 net::HttpAuthHandlerFactory::CreateDefault(host_resolver())); | 124 net::HttpAuthHandlerFactory::CreateDefault(host_resolver())); |
124 } | 125 } |
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
536 | 537 |
537 ScopedCustomUrlRequestTestHttpHost::~ScopedCustomUrlRequestTestHttpHost() { | 538 ScopedCustomUrlRequestTestHttpHost::~ScopedCustomUrlRequestTestHttpHost() { |
538 DCHECK_EQ(value_, new_value_); | 539 DCHECK_EQ(value_, new_value_); |
539 value_ = old_value_; | 540 value_ = old_value_; |
540 } | 541 } |
541 | 542 |
542 // static | 543 // static |
543 const std::string& ScopedCustomUrlRequestTestHttpHost::value() { | 544 const std::string& ScopedCustomUrlRequestTestHttpHost::value() { |
544 return value_; | 545 return value_; |
545 } | 546 } |
OLD | NEW |