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 |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 int options_; | 118 int options_; |
119 net::CompletionCallback* callback_; | 119 net::CompletionCallback* callback_; |
120 }; | 120 }; |
121 | 121 |
122 //----------------------------------------------------------------------------- | 122 //----------------------------------------------------------------------------- |
123 | 123 |
124 class TestURLRequestContext : public URLRequestContext { | 124 class TestURLRequestContext : public URLRequestContext { |
125 public: | 125 public: |
126 TestURLRequestContext() { | 126 TestURLRequestContext() { |
127 host_resolver_ = | 127 host_resolver_ = |
128 net::CreateSystemHostResolver(net::HostResolver::kDefaultParallelism); | 128 net::CreateSystemHostResolver(net::HostResolver::kDefaultParallelism, |
| 129 NULL); |
129 proxy_service_ = net::ProxyService::CreateNull(); | 130 proxy_service_ = net::ProxyService::CreateNull(); |
130 Init(); | 131 Init(); |
131 } | 132 } |
132 | 133 |
133 explicit TestURLRequestContext(const std::string& proxy) { | 134 explicit TestURLRequestContext(const std::string& proxy) { |
134 host_resolver_ = | 135 host_resolver_ = |
135 net::CreateSystemHostResolver(net::HostResolver::kDefaultParallelism); | 136 net::CreateSystemHostResolver(net::HostResolver::kDefaultParallelism, |
| 137 NULL); |
136 net::ProxyConfig proxy_config; | 138 net::ProxyConfig proxy_config; |
137 proxy_config.proxy_rules().ParseFromString(proxy); | 139 proxy_config.proxy_rules().ParseFromString(proxy); |
138 proxy_service_ = net::ProxyService::CreateFixed(proxy_config); | 140 proxy_service_ = net::ProxyService::CreateFixed(proxy_config); |
139 Init(); | 141 Init(); |
140 } | 142 } |
141 | 143 |
142 void set_cookie_policy(net::CookiePolicy* policy) { | 144 void set_cookie_policy(net::CookiePolicy* policy) { |
143 cookie_policy_ = policy; | 145 cookie_policy_ = policy; |
144 } | 146 } |
145 | 147 |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 bool received_data_before_response_; | 384 bool received_data_before_response_; |
383 bool request_failed_; | 385 bool request_failed_; |
384 bool have_certificate_errors_; | 386 bool have_certificate_errors_; |
385 std::string data_received_; | 387 std::string data_received_; |
386 | 388 |
387 // our read buffer | 389 // our read buffer |
388 scoped_refptr<net::IOBuffer> buf_; | 390 scoped_refptr<net::IOBuffer> buf_; |
389 }; | 391 }; |
390 | 392 |
391 #endif // NET_URL_REQUEST_URL_REQUEST_UNITTEST_H_ | 393 #endif // NET_URL_REQUEST_URL_REQUEST_UNITTEST_H_ |
OLD | NEW |