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

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

Issue 11931024: Removed static factories for data, ftp, file, and about jobs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add test for IsSafeRedirectTarget Created 7 years, 10 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"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 493 matching lines...) Expand 10 before | Expand all | Expand 10 after
586 URLRequestJob* job = main_intercept_job_; 578 URLRequestJob* job = main_intercept_job_;
587 main_intercept_job_ = NULL; 579 main_intercept_job_ = NULL;
588 return job; 580 return job;
589 } 581 }
590 582
591 void TestJobInterceptor::set_main_intercept_job(URLRequestJob* job) { 583 void TestJobInterceptor::set_main_intercept_job(URLRequestJob* job) {
592 main_intercept_job_ = job; 584 main_intercept_job_ = job;
593 } 585 }
594 586
595 } // namespace net 587 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698