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 } | |
83 if (!ssl_config_service()) | 75 if (!ssl_config_service()) |
84 context_storage_.set_ssl_config_service(new SSLConfigServiceDefaults); | 76 context_storage_.set_ssl_config_service(new SSLConfigServiceDefaults); |
85 if (!http_auth_handler_factory()) { | 77 if (!http_auth_handler_factory()) { |
86 context_storage_.set_http_auth_handler_factory( | 78 context_storage_.set_http_auth_handler_factory( |
87 HttpAuthHandlerFactory::CreateDefault(host_resolver())); | 79 HttpAuthHandlerFactory::CreateDefault(host_resolver())); |
88 } | 80 } |
89 if (!http_server_properties()) { | 81 if (!http_server_properties()) { |
90 context_storage_.set_http_server_properties( | 82 context_storage_.set_http_server_properties( |
91 new HttpServerPropertiesImpl); | 83 new HttpServerPropertiesImpl); |
92 } | 84 } |
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
587 URLRequestJob* job = main_intercept_job_; | 579 URLRequestJob* job = main_intercept_job_; |
588 main_intercept_job_ = NULL; | 580 main_intercept_job_ = NULL; |
589 return job; | 581 return job; |
590 } | 582 } |
591 | 583 |
592 void TestJobInterceptor::set_main_intercept_job(URLRequestJob* job) { | 584 void TestJobInterceptor::set_main_intercept_job(URLRequestJob* job) { |
593 main_intercept_job_ = job; | 585 main_intercept_job_ = job; |
594 } | 586 } |
595 | 587 |
596 } // namespace net | 588 } // namespace net |
OLD | NEW |