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/proxy/proxy_script_fetcher_impl.h" | 5 #include "net/proxy/proxy_script_fetcher_impl.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
11 #include "base/path_service.h" | 11 #include "base/path_service.h" |
12 #include "base/utf_string_conversions.h" | 12 #include "base/utf_string_conversions.h" |
13 #include "net/base/net_util.h" | 13 #include "net/base/net_util.h" |
14 #include "net/base/load_flags.h" | 14 #include "net/base/load_flags.h" |
| 15 #include "net/base/multi_threaded_cert_verifier.h" |
15 #include "net/base/ssl_config_service_defaults.h" | 16 #include "net/base/ssl_config_service_defaults.h" |
16 #include "net/base/test_completion_callback.h" | 17 #include "net/base/test_completion_callback.h" |
17 #include "net/disk_cache/disk_cache.h" | 18 #include "net/disk_cache/disk_cache.h" |
18 #include "net/http/http_cache.h" | 19 #include "net/http/http_cache.h" |
19 #include "net/http/http_network_session.h" | 20 #include "net/http/http_network_session.h" |
20 #include "net/http/http_server_properties_impl.h" | 21 #include "net/http/http_server_properties_impl.h" |
21 #include "net/test/test_server.h" | 22 #include "net/test/test_server.h" |
22 #include "net/url_request/url_request_context_storage.h" | 23 #include "net/url_request/url_request_context_storage.h" |
23 #include "net/url_request/url_request_job_factory.h" | 24 #include "net/url_request/url_request_job_factory.h" |
24 #include "net/url_request/url_request_test_util.h" | 25 #include "net/url_request/url_request_test_util.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 | 66 |
66 // A non-mock URL request which can access http:// and file:// urls. | 67 // A non-mock URL request which can access http:// and file:// urls. |
67 class RequestContext : public URLRequestContext { | 68 class RequestContext : public URLRequestContext { |
68 public: | 69 public: |
69 RequestContext() : ALLOW_THIS_IN_INITIALIZER_LIST(storage_(this)) { | 70 RequestContext() : ALLOW_THIS_IN_INITIALIZER_LIST(storage_(this)) { |
70 ProxyConfig no_proxy; | 71 ProxyConfig no_proxy; |
71 storage_.set_host_resolver( | 72 storage_.set_host_resolver( |
72 CreateSystemHostResolver(HostResolver::kDefaultParallelism, | 73 CreateSystemHostResolver(HostResolver::kDefaultParallelism, |
73 HostResolver::kDefaultRetryAttempts, | 74 HostResolver::kDefaultRetryAttempts, |
74 NULL)); | 75 NULL)); |
75 storage_.set_cert_verifier(new CertVerifier); | 76 storage_.set_cert_verifier(new MultiThreadedCertVerifier); |
76 storage_.set_proxy_service(ProxyService::CreateFixed(no_proxy)); | 77 storage_.set_proxy_service(ProxyService::CreateFixed(no_proxy)); |
77 storage_.set_ssl_config_service(new SSLConfigServiceDefaults); | 78 storage_.set_ssl_config_service(new SSLConfigServiceDefaults); |
78 storage_.set_http_server_properties(new HttpServerPropertiesImpl); | 79 storage_.set_http_server_properties(new HttpServerPropertiesImpl); |
79 | 80 |
80 HttpNetworkSession::Params params; | 81 HttpNetworkSession::Params params; |
81 params.host_resolver = host_resolver(); | 82 params.host_resolver = host_resolver(); |
82 params.cert_verifier = cert_verifier(); | 83 params.cert_verifier = cert_verifier(); |
83 params.proxy_service = proxy_service(); | 84 params.proxy_service = proxy_service(); |
84 params.ssl_config_service = ssl_config_service(); | 85 params.ssl_config_service = ssl_config_service(); |
85 params.http_server_properties = http_server_properties(); | 86 params.http_server_properties = http_server_properties(); |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 { | 409 { |
409 GURL url(kEncodedUrlBroken); | 410 GURL url(kEncodedUrlBroken); |
410 string16 text; | 411 string16 text; |
411 TestCompletionCallback callback; | 412 TestCompletionCallback callback; |
412 int result = pac_fetcher.Fetch(url, &text, callback.callback()); | 413 int result = pac_fetcher.Fetch(url, &text, callback.callback()); |
413 EXPECT_EQ(ERR_FAILED, result); | 414 EXPECT_EQ(ERR_FAILED, result); |
414 } | 415 } |
415 } | 416 } |
416 | 417 |
417 } // namespace net | 418 } // namespace net |
OLD | NEW |