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_listen_socket_unittest.h" | 5 #include "net/socket/tcp_listen_socket_unittest.h" |
6 | 6 |
7 #include <fcntl.h> | 7 #include <fcntl.h> |
8 #include <sys/types.h> | 8 #include <sys/types.h> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 #endif | 66 #endif |
67 | 67 |
68 NextAction(); | 68 NextAction(); |
69 ASSERT_EQ(ACTION_ACCEPT, last_action_.type()); | 69 ASSERT_EQ(ACTION_ACCEPT, last_action_.type()); |
70 } | 70 } |
71 | 71 |
72 void TCPListenSocketTester::TearDown() { | 72 void TCPListenSocketTester::TearDown() { |
73 #if defined(OS_WIN) | 73 #if defined(OS_WIN) |
74 ASSERT_EQ(0, closesocket(test_socket_)); | 74 ASSERT_EQ(0, closesocket(test_socket_)); |
75 #elif defined(OS_POSIX) | 75 #elif defined(OS_POSIX) |
76 ASSERT_EQ(0, HANDLE_EINTR(close(test_socket_))); | 76 ASSERT_EQ(0, IGNORE_EINTR(close(test_socket_))); |
77 #endif | 77 #endif |
78 NextAction(); | 78 NextAction(); |
79 ASSERT_EQ(ACTION_CLOSE, last_action_.type()); | 79 ASSERT_EQ(ACTION_CLOSE, last_action_.type()); |
80 | 80 |
81 loop_->PostTask(FROM_HERE, base::Bind( | 81 loop_->PostTask(FROM_HERE, base::Bind( |
82 &TCPListenSocketTester::Shutdown, this)); | 82 &TCPListenSocketTester::Shutdown, this)); |
83 NextAction(); | 83 NextAction(); |
84 ASSERT_EQ(ACTION_SHUTDOWN, last_action_.type()); | 84 ASSERT_EQ(ACTION_SHUTDOWN, last_action_.type()); |
85 | 85 |
86 thread_.reset(); | 86 thread_.reset(); |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 | 300 |
301 TEST_F(TCPListenSocketTest, ServerSend) { | 301 TEST_F(TCPListenSocketTest, ServerSend) { |
302 tester_->TestServerSend(); | 302 tester_->TestServerSend(); |
303 } | 303 } |
304 | 304 |
305 TEST_F(TCPListenSocketTest, ServerSendMultiple) { | 305 TEST_F(TCPListenSocketTest, ServerSendMultiple) { |
306 tester_->TestServerSendMultiple(); | 306 tester_->TestServerSendMultiple(); |
307 } | 307 } |
308 | 308 |
309 } // namespace net | 309 } // namespace net |
OLD | NEW |