| 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/tcp_client_socket.h" | 5 #include "net/socket/tcp_client_socket.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "net/base/address_list.h" | 10 #include "net/base/address_list.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 }; | 32 }; |
| 33 | 33 |
| 34 } // namespace | 34 } // namespace |
| 35 | 35 |
| 36 class TransportClientSocketTest | 36 class TransportClientSocketTest |
| 37 : public StreamListenSocket::Delegate, | 37 : public StreamListenSocket::Delegate, |
| 38 public ::testing::TestWithParam<ClientSocketTestTypes> { | 38 public ::testing::TestWithParam<ClientSocketTestTypes> { |
| 39 public: | 39 public: |
| 40 TransportClientSocketTest() | 40 TransportClientSocketTest() |
| 41 : listen_port_(0), | 41 : listen_port_(0), |
| 42 net_log_(CapturingNetLog::kUnbounded), | |
| 43 socket_factory_(ClientSocketFactory::GetDefaultFactory()), | 42 socket_factory_(ClientSocketFactory::GetDefaultFactory()), |
| 44 close_server_socket_on_next_send_(false) { | 43 close_server_socket_on_next_send_(false) { |
| 45 } | 44 } |
| 46 | 45 |
| 47 ~TransportClientSocketTest() { | 46 ~TransportClientSocketTest() { |
| 48 } | 47 } |
| 49 | 48 |
| 50 // Implement StreamListenSocket::Delegate methods | 49 // Implement StreamListenSocket::Delegate methods |
| 51 virtual void DidAccept(StreamListenSocket* server, | 50 virtual void DidAccept(StreamListenSocket* server, |
| 52 StreamListenSocket* connection) { | 51 StreamListenSocket* connection) { |
| (...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 440 | 439 |
| 441 // It's possible the read is blocked because it's already read all the data. | 440 // It's possible the read is blocked because it's already read all the data. |
| 442 // Close the server socket, so there will at least be a 0-byte read. | 441 // Close the server socket, so there will at least be a 0-byte read. |
| 443 CloseServerSocket(); | 442 CloseServerSocket(); |
| 444 | 443 |
| 445 rv = callback.WaitForResult(); | 444 rv = callback.WaitForResult(); |
| 446 EXPECT_GE(rv, 0); | 445 EXPECT_GE(rv, 0); |
| 447 } | 446 } |
| 448 | 447 |
| 449 } // namespace net | 448 } // namespace net |
| OLD | NEW |