| 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" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 DCHECK(!initialized_); | 60 DCHECK(!initialized_); |
| 61 initialized_ = true; | 61 initialized_ = true; |
| 62 | 62 |
| 63 if (!host_resolver()) | 63 if (!host_resolver()) |
| 64 context_storage_.set_host_resolver(new net::MockCachingHostResolver()); | 64 context_storage_.set_host_resolver(new net::MockCachingHostResolver()); |
| 65 if (!proxy_service()) | 65 if (!proxy_service()) |
| 66 context_storage_.set_proxy_service(net::ProxyService::CreateDirect()); | 66 context_storage_.set_proxy_service(net::ProxyService::CreateDirect()); |
| 67 if (!cert_verifier()) | 67 if (!cert_verifier()) |
| 68 context_storage_.set_cert_verifier(net::CertVerifier::CreateDefault()); | 68 context_storage_.set_cert_verifier(net::CertVerifier::CreateDefault()); |
| 69 if (!ftp_transaction_factory()) { | 69 if (!ftp_transaction_factory()) { |
| 70 #if !defined(DISABLE_FTP_SUPPORT) |
| 70 context_storage_.set_ftp_transaction_factory( | 71 context_storage_.set_ftp_transaction_factory( |
| 71 new net::FtpNetworkLayer(host_resolver())); | 72 new net::FtpNetworkLayer(host_resolver())); |
| 73 #else |
| 74 context_storage_.set_ftp_transaction_factory(NULL); |
| 75 #endif // !defined(DISABLE_FTP_SUPPORT) |
| 72 } | 76 } |
| 73 if (!ssl_config_service()) | 77 if (!ssl_config_service()) |
| 74 context_storage_.set_ssl_config_service(new net::SSLConfigServiceDefaults); | 78 context_storage_.set_ssl_config_service(new net::SSLConfigServiceDefaults); |
| 75 if (!http_auth_handler_factory()) { | 79 if (!http_auth_handler_factory()) { |
| 76 context_storage_.set_http_auth_handler_factory( | 80 context_storage_.set_http_auth_handler_factory( |
| 77 net::HttpAuthHandlerFactory::CreateDefault(host_resolver())); | 81 net::HttpAuthHandlerFactory::CreateDefault(host_resolver())); |
| 78 } | 82 } |
| 79 if (!http_server_properties()) { | 83 if (!http_server_properties()) { |
| 80 context_storage_.set_http_server_properties( | 84 context_storage_.set_http_server_properties( |
| 81 new net::HttpServerPropertiesImpl); | 85 new net::HttpServerPropertiesImpl); |
| (...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 517 | 521 |
| 518 ScopedCustomUrlRequestTestHttpHost::~ScopedCustomUrlRequestTestHttpHost() { | 522 ScopedCustomUrlRequestTestHttpHost::~ScopedCustomUrlRequestTestHttpHost() { |
| 519 DCHECK_EQ(value_, new_value_); | 523 DCHECK_EQ(value_, new_value_); |
| 520 value_ = old_value_; | 524 value_ = old_value_; |
| 521 } | 525 } |
| 522 | 526 |
| 523 // static | 527 // static |
| 524 const std::string& ScopedCustomUrlRequestTestHttpHost::value() { | 528 const std::string& ScopedCustomUrlRequestTestHttpHost::value() { |
| 525 return value_; | 529 return value_; |
| 526 } | 530 } |
| OLD | NEW |