OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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" |
11 #include "net/base/host_port_pair.h" | 11 #include "net/base/host_port_pair.h" |
12 #include "net/http/http_network_session.h" | 12 #include "net/http/http_network_session.h" |
13 #include "net/url_request/url_request_job_factory.h" | 13 #include "net/url_request/url_request_job_factory.h" |
14 | 14 |
15 TestURLRequestContext::TestURLRequestContext() | 15 TestURLRequestContext::TestURLRequestContext() |
16 : ALLOW_THIS_IN_INITIALIZER_LIST(context_storage_(this)) { | 16 : ALLOW_THIS_IN_INITIALIZER_LIST(context_storage_(this)) { |
17 context_storage_.set_host_resolver( | 17 context_storage_.set_host_resolver( |
18 net::CreateSystemHostResolver(net::HostResolver::kDefaultParallelism, | 18 net::CreateSystemHostResolver(net::HostResolver::kDefaultParallelism, |
| 19 net::HostResolver::kDefaultRetryAttempts, |
19 NULL)); | 20 NULL)); |
20 context_storage_.set_proxy_service(net::ProxyService::CreateDirect()); | 21 context_storage_.set_proxy_service(net::ProxyService::CreateDirect()); |
21 Init(); | 22 Init(); |
22 } | 23 } |
23 | 24 |
24 TestURLRequestContext::TestURLRequestContext(const std::string& proxy) | 25 TestURLRequestContext::TestURLRequestContext(const std::string& proxy) |
25 : ALLOW_THIS_IN_INITIALIZER_LIST(context_storage_(this)) { | 26 : ALLOW_THIS_IN_INITIALIZER_LIST(context_storage_(this)) { |
26 context_storage_.set_host_resolver( | 27 context_storage_.set_host_resolver( |
27 net::CreateSystemHostResolver(net::HostResolver::kDefaultParallelism, | 28 net::CreateSystemHostResolver(net::HostResolver::kDefaultParallelism, |
| 29 net::HostResolver::kDefaultRetryAttempts, |
28 NULL)); | 30 NULL)); |
29 net::ProxyConfig proxy_config; | 31 net::ProxyConfig proxy_config; |
30 proxy_config.proxy_rules().ParseFromString(proxy); | 32 proxy_config.proxy_rules().ParseFromString(proxy); |
31 context_storage_.set_proxy_service( | 33 context_storage_.set_proxy_service( |
32 net::ProxyService::CreateFixed(proxy_config)); | 34 net::ProxyService::CreateFixed(proxy_config)); |
33 Init(); | 35 Init(); |
34 } | 36 } |
35 | 37 |
36 TestURLRequestContext::TestURLRequestContext(const std::string& proxy, | 38 TestURLRequestContext::TestURLRequestContext(const std::string& proxy, |
37 net::HostResolver* host_resolver) | 39 net::HostResolver* host_resolver) |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 } | 296 } |
295 | 297 |
296 net::URLRequestJob* TestNetworkDelegate::OnMaybeCreateURLRequestJob( | 298 net::URLRequestJob* TestNetworkDelegate::OnMaybeCreateURLRequestJob( |
297 net::URLRequest* request) { | 299 net::URLRequest* request) { |
298 return NULL; | 300 return NULL; |
299 } | 301 } |
300 | 302 |
301 void TestNetworkDelegate::OnPACScriptError(int line_number, | 303 void TestNetworkDelegate::OnPACScriptError(int line_number, |
302 const string16& error) { | 304 const string16& error) { |
303 } | 305 } |
OLD | NEW |