| 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.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" | 10 #include "net/base/mock_host_resolver.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 SOCKSClientSocket* BuildMockSocket(MockRead reads[], size_t reads_count, | 30 SOCKSClientSocket* BuildMockSocket(MockRead reads[], size_t reads_count, |
| 31 MockWrite writes[], size_t writes_count, | 31 MockWrite writes[], size_t writes_count, |
| 32 HostResolver* host_resolver, | 32 HostResolver* host_resolver, |
| 33 const std::string& hostname, int port, | 33 const std::string& hostname, int port, |
| 34 NetLog* net_log); | 34 NetLog* net_log); |
| 35 virtual void SetUp(); | 35 virtual void SetUp(); |
| 36 | 36 |
| 37 protected: | 37 protected: |
| 38 scoped_ptr<SOCKSClientSocket> user_sock_; | 38 scoped_ptr<SOCKSClientSocket> user_sock_; |
| 39 AddressList address_list_; | 39 AddressList address_list_; |
| 40 ClientSocket* tcp_sock_; | 40 StreamSocket* tcp_sock_; |
| 41 TestCompletionCallback callback_; | 41 TestCompletionCallback callback_; |
| 42 scoped_ptr<MockHostResolver> host_resolver_; | 42 scoped_ptr<MockHostResolver> host_resolver_; |
| 43 scoped_ptr<SocketDataProvider> data_; | 43 scoped_ptr<SocketDataProvider> data_; |
| 44 }; | 44 }; |
| 45 | 45 |
| 46 SOCKSClientSocketTest::SOCKSClientSocketTest() | 46 SOCKSClientSocketTest::SOCKSClientSocketTest() |
| 47 : host_resolver_(new MockHostResolver) { | 47 : host_resolver_(new MockHostResolver) { |
| 48 } | 48 } |
| 49 | 49 |
| 50 // Set up platform before every test case | 50 // Set up platform before every test case |
| (...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 387 // Disconnect the SOCKS socket -- this should cancel the outstanding resolve. | 387 // Disconnect the SOCKS socket -- this should cancel the outstanding resolve. |
| 388 user_sock_->Disconnect(); | 388 user_sock_->Disconnect(); |
| 389 | 389 |
| 390 EXPECT_FALSE(hanging_resolver->HasOutstandingRequest()); | 390 EXPECT_FALSE(hanging_resolver->HasOutstandingRequest()); |
| 391 | 391 |
| 392 EXPECT_FALSE(user_sock_->IsConnected()); | 392 EXPECT_FALSE(user_sock_->IsConnected()); |
| 393 EXPECT_FALSE(user_sock_->IsConnectedAndIdle()); | 393 EXPECT_FALSE(user_sock_->IsConnectedAndIdle()); |
| 394 } | 394 } |
| 395 | 395 |
| 396 } // namespace net | 396 } // namespace net |
| OLD | NEW |