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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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, NULL); | 129 NULL); |
130 proxy_service_ = net::ProxyService::CreateDirect(); | 130 proxy_service_ = net::ProxyService::CreateDirect(); |
131 Init(); | 131 Init(); |
132 } | 132 } |
133 | 133 |
134 explicit TestURLRequestContext(const std::string& proxy) { | 134 explicit TestURLRequestContext(const std::string& proxy) { |
135 host_resolver_ = | 135 host_resolver_ = |
136 net::CreateSystemHostResolver(net::HostResolver::kDefaultParallelism, | 136 net::CreateSystemHostResolver(net::HostResolver::kDefaultParallelism, |
137 NULL, NULL); | 137 NULL); |
138 net::ProxyConfig proxy_config; | 138 net::ProxyConfig proxy_config; |
139 proxy_config.proxy_rules().ParseFromString(proxy); | 139 proxy_config.proxy_rules().ParseFromString(proxy); |
140 proxy_service_ = net::ProxyService::CreateFixed(proxy_config); | 140 proxy_service_ = net::ProxyService::CreateFixed(proxy_config); |
141 Init(); | 141 Init(); |
142 } | 142 } |
143 | 143 |
144 void set_cookie_policy(net::CookiePolicy* policy) { | 144 void set_cookie_policy(net::CookiePolicy* policy) { |
145 cookie_policy_ = policy; | 145 cookie_policy_ = policy; |
146 } | 146 } |
147 | 147 |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 bool received_data_before_response_; | 388 bool received_data_before_response_; |
389 bool request_failed_; | 389 bool request_failed_; |
390 bool have_certificate_errors_; | 390 bool have_certificate_errors_; |
391 std::string data_received_; | 391 std::string data_received_; |
392 | 392 |
393 // our read buffer | 393 // our read buffer |
394 scoped_refptr<net::IOBuffer> buf_; | 394 scoped_refptr<net::IOBuffer> buf_; |
395 }; | 395 }; |
396 | 396 |
397 #endif // NET_URL_REQUEST_URL_REQUEST_UNITTEST_H_ | 397 #endif // NET_URL_REQUEST_URL_REQUEST_UNITTEST_H_ |
OLD | NEW |