| 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 DCHECK(!initialized_); | 65 DCHECK(!initialized_); |
| 66 initialized_ = true; | 66 initialized_ = true; |
| 67 | 67 |
| 68 if (!host_resolver()) | 68 if (!host_resolver()) |
| 69 context_storage_.set_host_resolver( | 69 context_storage_.set_host_resolver( |
| 70 scoped_ptr<HostResolver>(new MockCachingHostResolver())); | 70 scoped_ptr<HostResolver>(new MockCachingHostResolver())); |
| 71 if (!proxy_service()) | 71 if (!proxy_service()) |
| 72 context_storage_.set_proxy_service(ProxyService::CreateDirect()); | 72 context_storage_.set_proxy_service(ProxyService::CreateDirect()); |
| 73 if (!cert_verifier()) | 73 if (!cert_verifier()) |
| 74 context_storage_.set_cert_verifier(CertVerifier::CreateDefault()); | 74 context_storage_.set_cert_verifier(CertVerifier::CreateDefault()); |
| 75 if (!ftp_transaction_factory()) { |
| 76 #if !defined(DISABLE_FTP_SUPPORT) |
| 77 context_storage_.set_ftp_transaction_factory( |
| 78 new FtpNetworkLayer(host_resolver())); |
| 79 #else |
| 80 context_storage_.set_ftp_transaction_factory(NULL); |
| 81 #endif // !defined(DISABLE_FTP_SUPPORT) |
| 82 } |
| 75 if (!ssl_config_service()) | 83 if (!ssl_config_service()) |
| 76 context_storage_.set_ssl_config_service(new SSLConfigServiceDefaults); | 84 context_storage_.set_ssl_config_service(new SSLConfigServiceDefaults); |
| 77 if (!http_auth_handler_factory()) { | 85 if (!http_auth_handler_factory()) { |
| 78 context_storage_.set_http_auth_handler_factory( | 86 context_storage_.set_http_auth_handler_factory( |
| 79 HttpAuthHandlerFactory::CreateDefault(host_resolver())); | 87 HttpAuthHandlerFactory::CreateDefault(host_resolver())); |
| 80 } | 88 } |
| 81 if (!http_server_properties()) { | 89 if (!http_server_properties()) { |
| 82 context_storage_.set_http_server_properties( | 90 context_storage_.set_http_server_properties( |
| 83 new HttpServerPropertiesImpl); | 91 new HttpServerPropertiesImpl); |
| 84 } | 92 } |
| (...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 584 URLRequestJob* job = main_intercept_job_; | 592 URLRequestJob* job = main_intercept_job_; |
| 585 main_intercept_job_ = NULL; | 593 main_intercept_job_ = NULL; |
| 586 return job; | 594 return job; |
| 587 } | 595 } |
| 588 | 596 |
| 589 void TestJobInterceptor::set_main_intercept_job(URLRequestJob* job) { | 597 void TestJobInterceptor::set_main_intercept_job(URLRequestJob* job) { |
| 590 main_intercept_job_ = job; | 598 main_intercept_job_ = job; |
| 591 } | 599 } |
| 592 | 600 |
| 593 } // namespace net | 601 } // namespace net |
| OLD | NEW |