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 | 7 |
8 #include <stdlib.h> | 8 #include <stdlib.h> |
9 | 9 |
10 #include <sstream> | 10 #include <sstream> |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 ScopedRunnableMethodFactory<TestCookiePolicy> method_factory_; | 124 ScopedRunnableMethodFactory<TestCookiePolicy> method_factory_; |
125 int options_; | 125 int options_; |
126 net::CompletionCallback* callback_; | 126 net::CompletionCallback* callback_; |
127 }; | 127 }; |
128 | 128 |
129 //----------------------------------------------------------------------------- | 129 //----------------------------------------------------------------------------- |
130 | 130 |
131 class TestURLRequestContext : public URLRequestContext { | 131 class TestURLRequestContext : public URLRequestContext { |
132 public: | 132 public: |
133 TestURLRequestContext() { | 133 TestURLRequestContext() { |
134 host_resolver_ = net::CreateSystemHostResolver(); | 134 host_resolver_ = |
| 135 net::CreateSystemHostResolver(net::HostResolver::kDefaultParallelism); |
135 proxy_service_ = net::ProxyService::CreateNull(); | 136 proxy_service_ = net::ProxyService::CreateNull(); |
136 Init(); | 137 Init(); |
137 } | 138 } |
138 | 139 |
139 explicit TestURLRequestContext(const std::string& proxy) { | 140 explicit TestURLRequestContext(const std::string& proxy) { |
140 host_resolver_ = net::CreateSystemHostResolver(); | 141 host_resolver_ = |
| 142 net::CreateSystemHostResolver(net::HostResolver::kDefaultParallelism); |
141 net::ProxyConfig proxy_config; | 143 net::ProxyConfig proxy_config; |
142 proxy_config.proxy_rules().ParseFromString(proxy); | 144 proxy_config.proxy_rules().ParseFromString(proxy); |
143 proxy_service_ = net::ProxyService::CreateFixed(proxy_config); | 145 proxy_service_ = net::ProxyService::CreateFixed(proxy_config); |
144 Init(); | 146 Init(); |
145 } | 147 } |
146 | 148 |
147 void set_cookie_policy(net::CookiePolicy* policy) { | 149 void set_cookie_policy(net::CookiePolicy* policy) { |
148 cookie_policy_ = policy; | 150 cookie_policy_ = policy; |
149 } | 151 } |
150 | 152 |
(...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
762 return false; | 764 return false; |
763 | 765 |
764 return true; | 766 return true; |
765 } | 767 } |
766 | 768 |
767 private: | 769 private: |
768 ~FTPTestServer() {} | 770 ~FTPTestServer() {} |
769 }; | 771 }; |
770 | 772 |
771 #endif // NET_URL_REQUEST_URL_REQUEST_UNITTEST_H_ | 773 #endif // NET_URL_REQUEST_URL_REQUEST_UNITTEST_H_ |
OLD | NEW |