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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 DCHECK(!initialized_); | 63 DCHECK(!initialized_); |
64 initialized_ = true; | 64 initialized_ = true; |
65 | 65 |
66 if (!host_resolver()) | 66 if (!host_resolver()) |
67 context_storage_.set_host_resolver( | 67 context_storage_.set_host_resolver( |
68 scoped_ptr<HostResolver>(new MockCachingHostResolver())); | 68 scoped_ptr<HostResolver>(new MockCachingHostResolver())); |
69 if (!proxy_service()) | 69 if (!proxy_service()) |
70 context_storage_.set_proxy_service(ProxyService::CreateDirect()); | 70 context_storage_.set_proxy_service(ProxyService::CreateDirect()); |
71 if (!cert_verifier()) | 71 if (!cert_verifier()) |
72 context_storage_.set_cert_verifier(CertVerifier::CreateDefault()); | 72 context_storage_.set_cert_verifier(CertVerifier::CreateDefault()); |
73 if (!ftp_transaction_factory()) { | |
74 #if !defined(DISABLE_FTP_SUPPORT) | |
75 context_storage_.set_ftp_transaction_factory( | |
76 new FtpNetworkLayer(host_resolver())); | |
77 #else | |
78 context_storage_.set_ftp_transaction_factory(NULL); | |
79 #endif // !defined(DISABLE_FTP_SUPPORT) | |
80 } | |
81 if (!ssl_config_service()) | 73 if (!ssl_config_service()) |
82 context_storage_.set_ssl_config_service(new SSLConfigServiceDefaults); | 74 context_storage_.set_ssl_config_service(new SSLConfigServiceDefaults); |
83 if (!http_auth_handler_factory()) { | 75 if (!http_auth_handler_factory()) { |
84 context_storage_.set_http_auth_handler_factory( | 76 context_storage_.set_http_auth_handler_factory( |
85 HttpAuthHandlerFactory::CreateDefault(host_resolver())); | 77 HttpAuthHandlerFactory::CreateDefault(host_resolver())); |
86 } | 78 } |
87 if (!http_server_properties()) { | 79 if (!http_server_properties()) { |
88 context_storage_.set_http_server_properties( | 80 context_storage_.set_http_server_properties( |
89 new HttpServerPropertiesImpl); | 81 new HttpServerPropertiesImpl); |
90 } | 82 } |
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
550 URLRequestJob* job = main_intercept_job_; | 542 URLRequestJob* job = main_intercept_job_; |
551 main_intercept_job_ = NULL; | 543 main_intercept_job_ = NULL; |
552 return job; | 544 return job; |
553 } | 545 } |
554 | 546 |
555 void TestJobInterceptor::set_main_intercept_job(URLRequestJob* job) { | 547 void TestJobInterceptor::set_main_intercept_job(URLRequestJob* job) { |
556 main_intercept_job_ = job; | 548 main_intercept_job_ = job; |
557 } | 549 } |
558 | 550 |
559 } // namespace net | 551 } // namespace net |
OLD | NEW |