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/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/threading/thread.h" | 10 #include "base/threading/thread.h" |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 params.net_log = net_log(); | 110 params.net_log = net_log(); |
111 context_storage_.set_http_transaction_factory(new HttpCache( | 111 context_storage_.set_http_transaction_factory(new HttpCache( |
112 new HttpNetworkSession(params), | 112 new HttpNetworkSession(params), |
113 HttpCache::DefaultBackend::InMemory(0))); | 113 HttpCache::DefaultBackend::InMemory(0))); |
114 } | 114 } |
115 // In-memory cookie store. | 115 // In-memory cookie store. |
116 if (!cookie_store()) | 116 if (!cookie_store()) |
117 context_storage_.set_cookie_store(new CookieMonster(NULL, NULL)); | 117 context_storage_.set_cookie_store(new CookieMonster(NULL, NULL)); |
118 // In-memory Channel ID service. | 118 // In-memory Channel ID service. |
119 if (!channel_id_service()) { | 119 if (!channel_id_service()) { |
120 context_storage_.set_channel_id_service( | 120 context_storage_.set_channel_id_service(make_scoped_ptr( |
121 new ChannelIDService( | 121 new ChannelIDService(new DefaultChannelIDStore(NULL), |
122 new DefaultChannelIDStore(NULL), | 122 base::WorkerPool::GetTaskRunner(true)))); |
123 base::WorkerPool::GetTaskRunner(true))); | |
124 } | 123 } |
125 if (!http_user_agent_settings()) { | 124 if (!http_user_agent_settings()) { |
126 context_storage_.set_http_user_agent_settings( | 125 context_storage_.set_http_user_agent_settings( |
127 new StaticHttpUserAgentSettings("en-us,fr", std::string())); | 126 new StaticHttpUserAgentSettings("en-us,fr", std::string())); |
128 } | 127 } |
129 if (!job_factory()) | 128 if (!job_factory()) |
130 context_storage_.set_job_factory(new URLRequestJobFactoryImpl); | 129 context_storage_.set_job_factory(new URLRequestJobFactoryImpl); |
131 } | 130 } |
132 | 131 |
133 TestURLRequestContextGetter::TestURLRequestContextGetter( | 132 TestURLRequestContextGetter::TestURLRequestContextGetter( |
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
640 URLRequestJob* job = main_intercept_job_; | 639 URLRequestJob* job = main_intercept_job_; |
641 main_intercept_job_ = NULL; | 640 main_intercept_job_ = NULL; |
642 return job; | 641 return job; |
643 } | 642 } |
644 | 643 |
645 void TestJobInterceptor::set_main_intercept_job(URLRequestJob* job) { | 644 void TestJobInterceptor::set_main_intercept_job(URLRequestJob* job) { |
646 main_intercept_job_ = job; | 645 main_intercept_job_ = job; |
647 } | 646 } |
648 | 647 |
649 } // namespace net | 648 } // namespace net |
OLD | NEW |