OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #ifndef NET_URL_REQUEST_URL_REQUEST_UNITTEST_H_ | 5 #ifndef NET_URL_REQUEST_URL_REQUEST_UNITTEST_H_ |
6 #define NET_URL_REQUEST_URL_REQUEST_UNITTEST_H_ | 6 #define NET_URL_REQUEST_URL_REQUEST_UNITTEST_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <stdlib.h> | 9 #include <stdlib.h> |
10 | 10 |
11 #include <sstream> | 11 #include <sstream> |
12 #include <string> | 12 #include <string> |
13 | 13 |
14 #include "base/logging.h" | 14 #include "base/logging.h" |
15 #include "base/message_loop.h" | 15 #include "base/message_loop.h" |
16 #include "base/path_service.h" | 16 #include "base/path_service.h" |
17 #include "base/process_util.h" | 17 #include "base/process_util.h" |
18 #include "base/string_util.h" | 18 #include "base/string_util.h" |
19 #include "base/string16.h" | 19 #include "base/string16.h" |
20 #include "base/thread.h" | 20 #include "base/thread.h" |
21 #include "base/time.h" | 21 #include "base/time.h" |
22 #include "base/utf_string_conversions.h" | 22 #include "base/utf_string_conversions.h" |
| 23 #include "net/base/cert_verifier.h" |
23 #include "net/base/cookie_monster.h" | 24 #include "net/base/cookie_monster.h" |
24 #include "net/base/cookie_policy.h" | 25 #include "net/base/cookie_policy.h" |
25 #include "net/base/host_resolver.h" | 26 #include "net/base/host_resolver.h" |
26 #include "net/base/io_buffer.h" | 27 #include "net/base/io_buffer.h" |
27 #include "net/base/net_errors.h" | 28 #include "net/base/net_errors.h" |
28 #include "net/base/ssl_config_service_defaults.h" | 29 #include "net/base/ssl_config_service_defaults.h" |
29 #include "net/disk_cache/disk_cache.h" | 30 #include "net/disk_cache/disk_cache.h" |
30 #include "net/ftp/ftp_network_layer.h" | 31 #include "net/ftp/ftp_network_layer.h" |
31 #include "net/http/http_auth_handler_factory.h" | 32 #include "net/http/http_auth_handler_factory.h" |
32 #include "net/http/http_cache.h" | 33 #include "net/http/http_cache.h" |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 | 144 |
144 void set_cookie_policy(net::CookiePolicy* policy) { | 145 void set_cookie_policy(net::CookiePolicy* policy) { |
145 cookie_policy_ = policy; | 146 cookie_policy_ = policy; |
146 } | 147 } |
147 | 148 |
148 protected: | 149 protected: |
149 virtual ~TestURLRequestContext() { | 150 virtual ~TestURLRequestContext() { |
150 delete ftp_transaction_factory_; | 151 delete ftp_transaction_factory_; |
151 delete http_transaction_factory_; | 152 delete http_transaction_factory_; |
152 delete http_auth_handler_factory_; | 153 delete http_auth_handler_factory_; |
| 154 delete cert_verifier_; |
153 delete host_resolver_; | 155 delete host_resolver_; |
154 } | 156 } |
155 | 157 |
156 private: | 158 private: |
157 void Init() { | 159 void Init() { |
| 160 cert_verifier_ = new net::CertVerifier; |
158 ftp_transaction_factory_ = new net::FtpNetworkLayer(host_resolver_); | 161 ftp_transaction_factory_ = new net::FtpNetworkLayer(host_resolver_); |
159 ssl_config_service_ = new net::SSLConfigServiceDefaults; | 162 ssl_config_service_ = new net::SSLConfigServiceDefaults; |
160 http_auth_handler_factory_ = net::HttpAuthHandlerFactory::CreateDefault( | 163 http_auth_handler_factory_ = net::HttpAuthHandlerFactory::CreateDefault( |
161 host_resolver_); | 164 host_resolver_); |
162 http_transaction_factory_ = new net::HttpCache( | 165 http_transaction_factory_ = new net::HttpCache( |
163 net::HttpNetworkLayer::CreateFactory(host_resolver_, | 166 net::HttpNetworkLayer::CreateFactory(host_resolver_, |
| 167 cert_verifier_, |
164 NULL /* dnsrr_resolver */, | 168 NULL /* dnsrr_resolver */, |
165 NULL /* dns_cert_checker */, | 169 NULL /* dns_cert_checker */, |
166 NULL /* ssl_host_info_factory */, | 170 NULL /* ssl_host_info_factory */, |
167 proxy_service_, | 171 proxy_service_, |
168 ssl_config_service_, | 172 ssl_config_service_, |
169 http_auth_handler_factory_, | 173 http_auth_handler_factory_, |
170 network_delegate_, | 174 network_delegate_, |
171 NULL), | 175 NULL), |
172 net::HttpCache::DefaultBackend::InMemory(0)); | 176 net::HttpCache::DefaultBackend::InMemory(0)); |
173 // In-memory cookie store. | 177 // In-memory cookie store. |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
391 bool received_data_before_response_; | 395 bool received_data_before_response_; |
392 bool request_failed_; | 396 bool request_failed_; |
393 bool have_certificate_errors_; | 397 bool have_certificate_errors_; |
394 std::string data_received_; | 398 std::string data_received_; |
395 | 399 |
396 // our read buffer | 400 // our read buffer |
397 scoped_refptr<net::IOBuffer> buf_; | 401 scoped_refptr<net::IOBuffer> buf_; |
398 }; | 402 }; |
399 | 403 |
400 #endif // NET_URL_REQUEST_URL_REQUEST_UNITTEST_H_ | 404 #endif // NET_URL_REQUEST_URL_REQUEST_UNITTEST_H_ |
OLD | NEW |