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 #ifndef NET_URL_REQUEST_URL_REQUEST_TEST_UTIL_H_ | 5 #ifndef NET_URL_REQUEST_URL_REQUEST_TEST_UTIL_H_ |
6 #define NET_URL_REQUEST_URL_REQUEST_TEST_UTIL_H_ | 6 #define NET_URL_REQUEST_URL_REQUEST_TEST_UTIL_H_ |
7 | 7 |
8 #include <stdlib.h> | 8 #include <stdlib.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
11 #include <string> | 11 #include <string> |
12 | 12 |
13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
14 #include "base/compiler_specific.h" | 14 #include "base/compiler_specific.h" |
15 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
16 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
17 #include "base/message_loop/message_loop_proxy.h" | 17 #include "base/message_loop/message_loop_proxy.h" |
18 #include "base/path_service.h" | 18 #include "base/path_service.h" |
19 #include "base/strings/string16.h" | 19 #include "base/strings/string16.h" |
20 #include "base/strings/string_util.h" | 20 #include "base/strings/string_util.h" |
21 #include "base/strings/utf_string_conversions.h" | 21 #include "base/strings/utf_string_conversions.h" |
22 #include "base/time/time.h" | 22 #include "base/time/time.h" |
23 #include "net/base/io_buffer.h" | 23 #include "net/base/io_buffer.h" |
24 #include "net/base/load_timing_info.h" | 24 #include "net/base/load_timing_info.h" |
25 #include "net/base/net_errors.h" | 25 #include "net/base/net_errors.h" |
26 #include "net/base/network_delegate.h" | 26 #include "net/base/network_delegate.h" |
27 #include "net/base/request_priority.h" | 27 #include "net/base/request_priority.h" |
| 28 #include "net/base/sdch_manager.h" |
28 #include "net/cert/cert_verifier.h" | 29 #include "net/cert/cert_verifier.h" |
29 #include "net/cookies/cookie_monster.h" | 30 #include "net/cookies/cookie_monster.h" |
30 #include "net/disk_cache/disk_cache.h" | 31 #include "net/disk_cache/disk_cache.h" |
31 #include "net/ftp/ftp_network_layer.h" | 32 #include "net/ftp/ftp_network_layer.h" |
32 #include "net/http/http_auth_handler_factory.h" | 33 #include "net/http/http_auth_handler_factory.h" |
33 #include "net/http/http_cache.h" | 34 #include "net/http/http_cache.h" |
34 #include "net/http/http_network_layer.h" | 35 #include "net/http/http_network_layer.h" |
35 #include "net/http/http_network_session.h" | 36 #include "net/http/http_network_session.h" |
36 #include "net/http/http_request_headers.h" | 37 #include "net/http/http_request_headers.h" |
37 #include "net/proxy/proxy_service.h" | 38 #include "net/proxy/proxy_service.h" |
(...skipping 27 matching lines...) Expand all Loading... |
65 return client_socket_factory_; | 66 return client_socket_factory_; |
66 } | 67 } |
67 void set_client_socket_factory(ClientSocketFactory* factory) { | 68 void set_client_socket_factory(ClientSocketFactory* factory) { |
68 client_socket_factory_ = factory; | 69 client_socket_factory_ = factory; |
69 } | 70 } |
70 | 71 |
71 void set_http_network_session_params( | 72 void set_http_network_session_params( |
72 const HttpNetworkSession::Params& params) { | 73 const HttpNetworkSession::Params& params) { |
73 } | 74 } |
74 | 75 |
| 76 void SetSdchManager(scoped_ptr<SdchManager> sdch_manager) { |
| 77 context_storage_.set_sdch_manager(sdch_manager.Pass()); |
| 78 } |
| 79 |
75 private: | 80 private: |
76 bool initialized_; | 81 bool initialized_; |
77 | 82 |
78 // Optional parameters to override default values. Note that values that | 83 // Optional parameters to override default values. Note that values that |
79 // point to other objects the TestURLRequestContext creates will be | 84 // point to other objects the TestURLRequestContext creates will be |
80 // overwritten. | 85 // overwritten. |
81 scoped_ptr<HttpNetworkSession::Params> http_network_session_params_; | 86 scoped_ptr<HttpNetworkSession::Params> http_network_session_params_; |
82 | 87 |
83 // Not owned: | 88 // Not owned: |
84 ClientSocketFactory* client_socket_factory_; | 89 ClientSocketFactory* client_socket_factory_; |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 NetworkDelegate* network_delegate) const OVERRIDE; | 413 NetworkDelegate* network_delegate) const OVERRIDE; |
409 void set_main_intercept_job(URLRequestJob* job); | 414 void set_main_intercept_job(URLRequestJob* job); |
410 | 415 |
411 private: | 416 private: |
412 mutable URLRequestJob* main_intercept_job_; | 417 mutable URLRequestJob* main_intercept_job_; |
413 }; | 418 }; |
414 | 419 |
415 } // namespace net | 420 } // namespace net |
416 | 421 |
417 #endif // NET_URL_REQUEST_URL_REQUEST_TEST_UTIL_H_ | 422 #endif // NET_URL_REQUEST_URL_REQUEST_TEST_UTIL_H_ |
OLD | NEW |