OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/callback.h" | 7 #include "base/callback.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/time.h" | 9 #include "base/time.h" |
10 #include "net/base/mock_host_resolver.h" | 10 #include "net/base/mock_host_resolver.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 SocketDataProvider* data_provider() { return data_.get(); } | 47 SocketDataProvider* data_provider() { return data_.get(); } |
48 | 48 |
49 private: | 49 private: |
50 scoped_ptr<StaticSocketDataProvider> data_; | 50 scoped_ptr<StaticSocketDataProvider> data_; |
51 scoped_array<MockWrite> writes_; | 51 scoped_array<MockWrite> writes_; |
52 scoped_array<MockWrite> reads_; | 52 scoped_array<MockWrite> reads_; |
53 }; | 53 }; |
54 | 54 |
55 SOCKSClientSocketPoolTest() | 55 SOCKSClientSocketPoolTest() |
56 : ignored_transport_socket_params_(new TransportSocketParams( | 56 : ignored_transport_socket_params_(new TransportSocketParams( |
57 HostPortPair("proxy", 80), MEDIUM, GURL(), false, false)), | 57 HostPortPair("proxy", 80), MEDIUM, false, false)), |
58 transport_histograms_("MockTCP"), | 58 transport_histograms_("MockTCP"), |
59 transport_socket_pool_( | 59 transport_socket_pool_( |
60 kMaxSockets, kMaxSocketsPerGroup, | 60 kMaxSockets, kMaxSocketsPerGroup, |
61 &transport_histograms_, | 61 &transport_histograms_, |
62 &transport_client_socket_factory_), | 62 &transport_client_socket_factory_), |
63 ignored_socket_params_(new SOCKSSocketParams( | 63 ignored_socket_params_(new SOCKSSocketParams( |
64 ignored_transport_socket_params_, true, HostPortPair("host", 80), | 64 ignored_transport_socket_params_, true, HostPortPair("host", 80), |
65 MEDIUM, GURL())), | 65 MEDIUM)), |
66 socks_histograms_("SOCKSUnitTest"), | 66 socks_histograms_("SOCKSUnitTest"), |
67 pool_(kMaxSockets, kMaxSocketsPerGroup, | 67 pool_(kMaxSockets, kMaxSocketsPerGroup, |
68 &socks_histograms_, | 68 &socks_histograms_, |
69 NULL, | 69 NULL, |
70 &transport_socket_pool_, | 70 &transport_socket_pool_, |
71 NULL) { | 71 NULL) { |
72 } | 72 } |
73 | 73 |
74 virtual ~SOCKSClientSocketPoolTest() {} | 74 virtual ~SOCKSClientSocketPoolTest() {} |
75 | 75 |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 | 266 |
267 (*requests())[0]->handle()->Reset(); | 267 (*requests())[0]->handle()->Reset(); |
268 (*requests())[1]->handle()->Reset(); | 268 (*requests())[1]->handle()->Reset(); |
269 } | 269 } |
270 | 270 |
271 // It would be nice to also test the timeouts in SOCKSClientSocketPool. | 271 // It would be nice to also test the timeouts in SOCKSClientSocketPool. |
272 | 272 |
273 } // namespace | 273 } // namespace |
274 | 274 |
275 } // namespace net | 275 } // namespace net |
OLD | NEW |