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/socks5_client_socket.h" | 5 #include "net/socket/socks5_client_socket.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "net/base/address_list.h" | 10 #include "net/base/address_list.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 net_log_(CapturingNetLog::kUnbounded), | 60 net_log_(CapturingNetLog::kUnbounded), |
61 host_resolver_(new MockHostResolver) { | 61 host_resolver_(new MockHostResolver) { |
62 } | 62 } |
63 | 63 |
64 // Set up platform before every test case | 64 // Set up platform before every test case |
65 void SOCKS5ClientSocketTest::SetUp() { | 65 void SOCKS5ClientSocketTest::SetUp() { |
66 PlatformTest::SetUp(); | 66 PlatformTest::SetUp(); |
67 | 67 |
68 // Resolve the "localhost" AddressList used by the TCP connection to connect. | 68 // Resolve the "localhost" AddressList used by the TCP connection to connect. |
69 HostResolver::RequestInfo info("www.socks-proxy.com", 1080); | 69 HostResolver::RequestInfo info("www.socks-proxy.com", 1080); |
70 int rv = host_resolver_->Resolve(info, &address_list_, NULL, NULL, NULL); | 70 int rv = host_resolver_->Resolve(info, &address_list_, NULL, NULL, |
| 71 BoundNetLog()); |
71 ASSERT_EQ(OK, rv); | 72 ASSERT_EQ(OK, rv); |
72 } | 73 } |
73 | 74 |
74 SOCKS5ClientSocket* SOCKS5ClientSocketTest::BuildMockSocket( | 75 SOCKS5ClientSocket* SOCKS5ClientSocketTest::BuildMockSocket( |
75 MockRead reads[], | 76 MockRead reads[], |
76 size_t reads_count, | 77 size_t reads_count, |
77 MockWrite writes[], | 78 MockWrite writes[], |
78 size_t writes_count, | 79 size_t writes_count, |
79 const std::string& hostname, | 80 const std::string& hostname, |
80 int port, | 81 int port, |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 EXPECT_EQ(OK, rv); | 333 EXPECT_EQ(OK, rv); |
333 EXPECT_TRUE(user_sock_->IsConnected()); | 334 EXPECT_TRUE(user_sock_->IsConnected()); |
334 EXPECT_TRUE(LogContainsEndEvent(net_log_.entries(), -1, | 335 EXPECT_TRUE(LogContainsEndEvent(net_log_.entries(), -1, |
335 NetLog::TYPE_SOCKS5_CONNECT)); | 336 NetLog::TYPE_SOCKS5_CONNECT)); |
336 } | 337 } |
337 } | 338 } |
338 | 339 |
339 } // namespace | 340 } // namespace |
340 | 341 |
341 } // namespace net | 342 } // namespace net |
OLD | NEW |