| 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/socks5_client_socket.h" | 5 #include "net/socket/socks5_client_socket.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <iterator> | 8 #include <iterator> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <utility> | 10 #include <utility> |
| 11 | 11 |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "base/sys_byteorder.h" | 13 #include "base/sys_byteorder.h" |
| 14 #include "net/base/address_list.h" | 14 #include "net/base/address_list.h" |
| 15 #include "net/base/test_completion_callback.h" | 15 #include "net/base/test_completion_callback.h" |
| 16 #include "net/base/winsock_init.h" | 16 #include "net/base/winsock_init.h" |
| 17 #include "net/dns/mock_host_resolver.h" | 17 #include "net/dns/mock_host_resolver.h" |
| 18 #include "net/log/net_log.h" | |
| 19 #include "net/log/net_log_event_type.h" | 18 #include "net/log/net_log_event_type.h" |
| 20 #include "net/log/test_net_log.h" | 19 #include "net/log/test_net_log.h" |
| 21 #include "net/log/test_net_log_entry.h" | 20 #include "net/log/test_net_log_entry.h" |
| 22 #include "net/log/test_net_log_util.h" | 21 #include "net/log/test_net_log_util.h" |
| 23 #include "net/socket/client_socket_factory.h" | 22 #include "net/socket/client_socket_factory.h" |
| 24 #include "net/socket/socket_test_util.h" | 23 #include "net/socket/socket_test_util.h" |
| 25 #include "net/socket/tcp_client_socket.h" | 24 #include "net/socket/tcp_client_socket.h" |
| 26 #include "net/test/gtest_util.h" | 25 #include "net/test/gtest_util.h" |
| 27 #include "testing/gmock/include/gmock/gmock.h" | 26 #include "testing/gmock/include/gmock/gmock.h" |
| 28 #include "testing/gtest/include/gtest/gtest.h" | 27 #include "testing/gtest/include/gtest/gtest.h" |
| 29 #include "testing/platform_test.h" | 28 #include "testing/platform_test.h" |
| 30 | 29 |
| 31 using net::test::IsError; | 30 using net::test::IsError; |
| 32 using net::test::IsOk; | 31 using net::test::IsOk; |
| 33 | 32 |
| 34 //----------------------------------------------------------------------------- | 33 //----------------------------------------------------------------------------- |
| 35 | 34 |
| 36 namespace net { | 35 namespace net { |
| 37 | 36 |
| 37 class NetLog; |
| 38 |
| 38 namespace { | 39 namespace { |
| 39 | 40 |
| 40 // Base class to test SOCKS5ClientSocket | 41 // Base class to test SOCKS5ClientSocket |
| 41 class SOCKS5ClientSocketTest : public PlatformTest { | 42 class SOCKS5ClientSocketTest : public PlatformTest { |
| 42 public: | 43 public: |
| 43 SOCKS5ClientSocketTest(); | 44 SOCKS5ClientSocketTest(); |
| 44 // Create a SOCKSClientSocket on top of a MockSocket. | 45 // Create a SOCKSClientSocket on top of a MockSocket. |
| 45 std::unique_ptr<SOCKS5ClientSocket> BuildMockSocket( | 46 std::unique_ptr<SOCKS5ClientSocket> BuildMockSocket( |
| 46 MockRead reads[], | 47 MockRead reads[], |
| 47 size_t reads_count, | 48 size_t reads_count, |
| (...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 EXPECT_TRUE(user_sock_->IsConnected()); | 380 EXPECT_TRUE(user_sock_->IsConnected()); |
| 380 net_log_.GetEntries(&net_log_entries); | 381 net_log_.GetEntries(&net_log_entries); |
| 381 EXPECT_TRUE(LogContainsEndEvent(net_log_entries, -1, | 382 EXPECT_TRUE(LogContainsEndEvent(net_log_entries, -1, |
| 382 NetLogEventType::SOCKS5_CONNECT)); | 383 NetLogEventType::SOCKS5_CONNECT)); |
| 383 } | 384 } |
| 384 } | 385 } |
| 385 | 386 |
| 386 } // namespace | 387 } // namespace |
| 387 | 388 |
| 388 } // namespace net | 389 } // namespace net |
| OLD | NEW |