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.h" | 5 #include "net/socket/socks_client_socket.h" |
6 | 6 |
7 #include "net/base/address_list.h" | 7 #include "net/base/address_list.h" |
8 #include "net/base/net_log.h" | 8 #include "net/base/net_log.h" |
9 #include "net/base/net_log_unittest.h" | 9 #include "net/base/net_log_unittest.h" |
10 #include "net/base/mock_host_resolver.h" | |
11 #include "net/base/test_completion_callback.h" | 10 #include "net/base/test_completion_callback.h" |
12 #include "net/base/winsock_init.h" | 11 #include "net/base/winsock_init.h" |
| 12 #include "net/dns/mock_host_resolver.h" |
13 #include "net/socket/client_socket_factory.h" | 13 #include "net/socket/client_socket_factory.h" |
| 14 #include "net/socket/socket_test_util.h" |
14 #include "net/socket/tcp_client_socket.h" | 15 #include "net/socket/tcp_client_socket.h" |
15 #include "net/socket/socket_test_util.h" | |
16 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
17 #include "testing/platform_test.h" | 17 #include "testing/platform_test.h" |
18 | 18 |
19 //----------------------------------------------------------------------------- | 19 //----------------------------------------------------------------------------- |
20 | 20 |
21 namespace net { | 21 namespace net { |
22 | 22 |
23 const char kSOCKSOkRequest[] = { 0x04, 0x01, 0x00, 0x50, 127, 0, 0, 1, 0 }; | 23 const char kSOCKSOkRequest[] = { 0x04, 0x01, 0x00, 0x50, 127, 0, 0, 1, 0 }; |
24 const char kSOCKSOkReply[] = { 0x00, 0x5A, 0x00, 0x00, 0, 0, 0, 0 }; | 24 const char kSOCKSOkReply[] = { 0x00, 0x5A, 0x00, 0x00, 0, 0, 0, 0 }; |
25 | 25 |
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
395 // Disconnect the SOCKS socket -- this should cancel the outstanding resolve. | 395 // Disconnect the SOCKS socket -- this should cancel the outstanding resolve. |
396 user_sock_->Disconnect(); | 396 user_sock_->Disconnect(); |
397 | 397 |
398 EXPECT_FALSE(hanging_resolver->HasOutstandingRequest()); | 398 EXPECT_FALSE(hanging_resolver->HasOutstandingRequest()); |
399 | 399 |
400 EXPECT_FALSE(user_sock_->IsConnected()); | 400 EXPECT_FALSE(user_sock_->IsConnected()); |
401 EXPECT_FALSE(user_sock_->IsConnectedAndIdle()); | 401 EXPECT_FALSE(user_sock_->IsConnectedAndIdle()); |
402 } | 402 } |
403 | 403 |
404 } // namespace net | 404 } // namespace net |
OLD | NEW |