OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 | 42 |
43 data_.reset(new StaticSocketDataProvider(reads_.get(), 3, | 43 data_.reset(new StaticSocketDataProvider(reads_.get(), 3, |
44 writes_.get(), 3)); | 44 writes_.get(), 3)); |
45 } | 45 } |
46 | 46 |
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<MockRead> 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, false, false, | 57 HostPortPair("proxy", 80), MEDIUM, false, false, |
58 OnHostResolutionCallback())), | 58 OnHostResolutionCallback())), |
59 transport_histograms_("MockTCP"), | 59 transport_histograms_("MockTCP"), |
60 transport_socket_pool_( | 60 transport_socket_pool_( |
61 kMaxSockets, kMaxSocketsPerGroup, | 61 kMaxSockets, kMaxSocketsPerGroup, |
62 &transport_histograms_, | 62 &transport_histograms_, |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 | 268 |
269 (*requests())[0]->handle()->Reset(); | 269 (*requests())[0]->handle()->Reset(); |
270 (*requests())[1]->handle()->Reset(); | 270 (*requests())[1]->handle()->Reset(); |
271 } | 271 } |
272 | 272 |
273 // It would be nice to also test the timeouts in SOCKSClientSocketPool. | 273 // It would be nice to also test the timeouts in SOCKSClientSocketPool. |
274 | 274 |
275 } // namespace | 275 } // namespace |
276 | 276 |
277 } // namespace net | 277 } // namespace net |
OLD | NEW |