| 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 #include "net/socket/socks_client_socket_pool.h" | 5 #include "net/socket/socks_client_socket_pool.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 | 161 |
| 162 SocketDataProvider* data_provider() { return data_.get(); } | 162 SocketDataProvider* data_provider() { return data_.get(); } |
| 163 | 163 |
| 164 private: | 164 private: |
| 165 scoped_ptr<StaticSocketDataProvider> data_; | 165 scoped_ptr<StaticSocketDataProvider> data_; |
| 166 scoped_array<MockWrite> writes_; | 166 scoped_array<MockWrite> writes_; |
| 167 scoped_array<MockWrite> reads_; | 167 scoped_array<MockWrite> reads_; |
| 168 }; | 168 }; |
| 169 | 169 |
| 170 SOCKSClientSocketPoolTest() | 170 SOCKSClientSocketPoolTest() |
| 171 : ignored_tcp_socket_params_("proxy", 80, MEDIUM, GURL(), false), | 171 : ignored_tcp_socket_params_( |
| 172 HostPortPair("proxy", 80), MEDIUM, GURL(), false), |
| 172 tcp_socket_pool_(new MockTCPClientSocketPool( | 173 tcp_socket_pool_(new MockTCPClientSocketPool( |
| 173 kMaxSockets, kMaxSocketsPerGroup, "MockTCP", | 174 kMaxSockets, kMaxSocketsPerGroup, "MockTCP", |
| 174 &tcp_client_socket_factory_, &tcp_notifier_)), | 175 &tcp_client_socket_factory_, &tcp_notifier_)), |
| 175 ignored_socket_params_(ignored_tcp_socket_params_, true, "host", 80, | 176 ignored_socket_params_(ignored_tcp_socket_params_, true, |
| 176 MEDIUM, GURL()), | 177 HostPortPair("host", 80), |
| 177 pool_(new SOCKSClientSocketPool(kMaxSockets, kMaxSocketsPerGroup, | 178 MEDIUM, GURL()), |
| 178 "SOCKSUnitTest", NULL, tcp_socket_pool_.get(), &socks_notifier_)) { | 179 pool_(new SOCKSClientSocketPool( |
| 180 kMaxSockets, kMaxSocketsPerGroup, "SOCKSUnitTest", NULL, |
| 181 tcp_socket_pool_.get(), &socks_notifier_)) { |
| 179 } | 182 } |
| 180 | 183 |
| 181 int StartRequest(const std::string& group_name, RequestPriority priority) { | 184 int StartRequest(const std::string& group_name, RequestPriority priority) { |
| 182 return StartRequestUsingPool( | 185 return StartRequestUsingPool( |
| 183 pool_, group_name, priority, ignored_socket_params_); | 186 pool_, group_name, priority, ignored_socket_params_); |
| 184 } | 187 } |
| 185 | 188 |
| 186 TCPSocketParams ignored_tcp_socket_params_; | 189 TCPSocketParams ignored_tcp_socket_params_; |
| 187 MockClientSocketFactory tcp_client_socket_factory_; | 190 MockClientSocketFactory tcp_client_socket_factory_; |
| 188 MockNetworkChangeNotifier tcp_notifier_; | 191 MockNetworkChangeNotifier tcp_notifier_; |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 362 | 365 |
| 363 requests_[0]->handle()->Reset(); | 366 requests_[0]->handle()->Reset(); |
| 364 requests_[1]->handle()->Reset(); | 367 requests_[1]->handle()->Reset(); |
| 365 } | 368 } |
| 366 | 369 |
| 367 // It would be nice to also test the timeouts in SOCKSClientSocketPool. | 370 // It would be nice to also test the timeouts in SOCKSClientSocketPool. |
| 368 | 371 |
| 369 } // namespace | 372 } // namespace |
| 370 | 373 |
| 371 } // namespace net | 374 } // namespace net |
| OLD | NEW |