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

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

Issue 10918279: Provide mutable members of UrlRequestContext via pure-virtual interface (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 // In-memory cookie store. 101 // In-memory cookie store.
102 if (!cookie_store()) 102 if (!cookie_store())
103 context_storage_.set_cookie_store(new net::CookieMonster(NULL, NULL)); 103 context_storage_.set_cookie_store(new net::CookieMonster(NULL, NULL));
104 // In-memory origin bound cert service. 104 // In-memory origin bound cert service.
105 if (!server_bound_cert_service()) { 105 if (!server_bound_cert_service()) {
106 context_storage_.set_server_bound_cert_service( 106 context_storage_.set_server_bound_cert_service(
107 new net::ServerBoundCertService( 107 new net::ServerBoundCertService(
108 new net::DefaultServerBoundCertStore(NULL), 108 new net::DefaultServerBoundCertStore(NULL),
109 base::WorkerPool::GetTaskRunner(true))); 109 base::WorkerPool::GetTaskRunner(true)));
110 } 110 }
111 if (accept_language().empty()) 111 if (accept_language().empty()) {
erikwright (departed) 2012/09/21 15:06:33 It might be more correct to provide a method: Tes
pauljensen 2012/09/24 20:21:15 Why would this be more correct?
112 set_accept_language("en-us,fr"); 112 context_storage_.set_http_user_agent_settings(
113 if (accept_charset().empty()) 113 new net::ConstHttpUserAgentSettings(
114 set_accept_charset("iso-8859-1,*,utf-8"); 114 "en-us,fr", accept_charset(), EmptyString()));
115 }
116 if (accept_charset().empty()) {
117 context_storage_.set_http_user_agent_settings(
118 new net::ConstHttpUserAgentSettings(
119 accept_language(), "iso-8859-1,*,utf-8", EmptyString()));
120 }
115 if (!job_factory()) 121 if (!job_factory())
116 context_storage_.set_job_factory(new net::URLRequestJobFactoryImpl); 122 context_storage_.set_job_factory(new net::URLRequestJobFactoryImpl);
117 } 123 }
118 124
119 TestURLRequest::TestURLRequest(const GURL& url, 125 TestURLRequest::TestURLRequest(const GURL& url,
120 Delegate* delegate, 126 Delegate* delegate,
121 TestURLRequestContext* context) 127 TestURLRequestContext* context)
122 : net::URLRequest(url, delegate, context) { 128 : net::URLRequest(url, delegate, context) {
123 } 129 }
124 130
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after
549 555
550 net::URLRequestJob* TestJobInterceptor::MaybeInterceptResponse( 556 net::URLRequestJob* TestJobInterceptor::MaybeInterceptResponse(
551 net::URLRequest* request, 557 net::URLRequest* request,
552 net::NetworkDelegate* network_delegate) const { 558 net::NetworkDelegate* network_delegate) const {
553 return NULL; 559 return NULL;
554 } 560 }
555 561
556 void TestJobInterceptor::set_main_intercept_job(net::URLRequestJob* job) { 562 void TestJobInterceptor::set_main_intercept_job(net::URLRequestJob* job) {
557 main_intercept_job_ = job; 563 main_intercept_job_ = job;
558 } 564 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698