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 13 matching lines...) Expand all Loading... |
24 | 24 |
25 namespace { | 25 namespace { |
26 | 26 |
27 const char kServerReply[] = "HTTP/1.1 404 Not Found"; | 27 const char kServerReply[] = "HTTP/1.1 404 Not Found"; |
28 | 28 |
29 enum ClientSocketTestTypes { | 29 enum ClientSocketTestTypes { |
30 TCP, | 30 TCP, |
31 SCTP | 31 SCTP |
32 }; | 32 }; |
33 | 33 |
| 34 } // namespace |
| 35 |
34 class TransportClientSocketTest | 36 class TransportClientSocketTest |
35 : public ListenSocket::ListenSocketDelegate, | 37 : public ListenSocket::ListenSocketDelegate, |
36 public ::testing::TestWithParam<ClientSocketTestTypes> { | 38 public ::testing::TestWithParam<ClientSocketTestTypes> { |
37 public: | 39 public: |
38 TransportClientSocketTest() | 40 TransportClientSocketTest() |
39 : listen_port_(0), | 41 : listen_port_(0), |
40 net_log_(CapturingNetLog::kUnbounded), | 42 net_log_(CapturingNetLog::kUnbounded), |
41 socket_factory_(ClientSocketFactory::GetDefaultFactory()), | 43 socket_factory_(ClientSocketFactory::GetDefaultFactory()), |
42 close_server_socket_on_next_send_(false) { | 44 close_server_socket_on_next_send_(false) { |
43 } | 45 } |
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
438 EXPECT_GE(rv, 0); | 440 EXPECT_GE(rv, 0); |
439 | 441 |
440 // It's possible the read is blocked because it's already read all the data. | 442 // It's possible the read is blocked because it's already read all the data. |
441 // Close the server socket, so there will at least be a 0-byte read. | 443 // Close the server socket, so there will at least be a 0-byte read. |
442 CloseServerSocket(); | 444 CloseServerSocket(); |
443 | 445 |
444 rv = callback.WaitForResult(); | 446 rv = callback.WaitForResult(); |
445 EXPECT_GE(rv, 0); | 447 EXPECT_GE(rv, 0); |
446 } | 448 } |
447 | 449 |
448 } // namespace | |
449 | |
450 } // namespace net | 450 } // namespace net |
OLD | NEW |