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

Side by Side Diff: net/url_request/url_request_test_util.cc

Issue 9476035: Make CertVerifier a pure virtual interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Two header fixes Created 8 years, 9 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 | Annotate | Revision Log
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 "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 18
18 namespace { 19 namespace {
19 20
20 // These constants put the net::NetworkDelegate events of TestNetworkDelegate 21 // These constants put the net::NetworkDelegate events of TestNetworkDelegate
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 } 104 }
104 105
105 TestURLRequestContext::~TestURLRequestContext() { 106 TestURLRequestContext::~TestURLRequestContext() {
106 DCHECK(initialized_); 107 DCHECK(initialized_);
107 } 108 }
108 109
109 void TestURLRequestContext::Init() { 110 void TestURLRequestContext::Init() {
110 DCHECK(!initialized_); 111 DCHECK(!initialized_);
111 initialized_ = true; 112 initialized_ = true;
112 if (!cert_verifier()) 113 if (!cert_verifier())
113 context_storage_.set_cert_verifier(new net::CertVerifier); 114 context_storage_.set_cert_verifier(
115 net::CertVerifier::CreateDefaultCertVerifier());
114 if (!ftp_transaction_factory()) { 116 if (!ftp_transaction_factory()) {
115 context_storage_.set_ftp_transaction_factory( 117 context_storage_.set_ftp_transaction_factory(
116 new net::FtpNetworkLayer(host_resolver())); 118 new net::FtpNetworkLayer(host_resolver()));
117 } 119 }
118 if (!ssl_config_service()) 120 if (!ssl_config_service())
119 context_storage_.set_ssl_config_service(new net::SSLConfigServiceDefaults); 121 context_storage_.set_ssl_config_service(new net::SSLConfigServiceDefaults);
120 if (!http_auth_handler_factory()) { 122 if (!http_auth_handler_factory()) {
121 context_storage_.set_http_auth_handler_factory( 123 context_storage_.set_http_auth_handler_factory(
122 net::HttpAuthHandlerFactory::CreateDefault(host_resolver())); 124 net::HttpAuthHandlerFactory::CreateDefault(host_resolver()));
123 } 125 }
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
517 519
518 ScopedCustomUrlRequestTestHttpHost::~ScopedCustomUrlRequestTestHttpHost() { 520 ScopedCustomUrlRequestTestHttpHost::~ScopedCustomUrlRequestTestHttpHost() {
519 DCHECK_EQ(value_, new_value_); 521 DCHECK_EQ(value_, new_value_);
520 value_ = old_value_; 522 value_ = old_value_;
521 } 523 }
522 524
523 // static 525 // static
524 const std::string& ScopedCustomUrlRequestTestHttpHost::value() { 526 const std::string& ScopedCustomUrlRequestTestHttpHost::value() {
525 return value_; 527 return value_;
526 } 528 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698