| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <arpa/inet.h> | 5 #include <arpa/inet.h> |
| 6 #include <errno.h> | 6 #include <errno.h> |
| 7 #include <fcntl.h> | 7 #include <fcntl.h> |
| 8 #include <netinet/in.h> | 8 #include <netinet/in.h> |
| 9 #include <pthread.h> | 9 #include <pthread.h> |
| 10 #include <sys/types.h> | 10 #include <sys/types.h> |
| (...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 577 | 577 |
| 578 free(inbuf); | 578 free(inbuf); |
| 579 free(outbuf); | 579 free(outbuf); |
| 580 } | 580 } |
| 581 | 581 |
| 582 TEST_F(SocketTestUDP, Listen) { | 582 TEST_F(SocketTestUDP, Listen) { |
| 583 EXPECT_EQ(-1, ki_listen(sock1_, 10)); | 583 EXPECT_EQ(-1, ki_listen(sock1_, 10)); |
| 584 EXPECT_EQ(errno, ENOTSUP); | 584 EXPECT_EQ(errno, ENOTSUP); |
| 585 } | 585 } |
| 586 | 586 |
| 587 TEST_F(SocketTestTCP, Listen) { | 587 // Temporarily disable the TCP Listen test on PNaCl; |
| 588 // TODO(sbc): Re-enable once we fix the issue: http://crbug/377084 |
| 589 #ifdef __pnacl__ |
| 590 #define MAYBE_Listen DISABLED_Listen |
| 591 #else |
| 592 #define MAYBE_Listen Listen |
| 593 #endif |
| 594 |
| 595 TEST_F(SocketTestTCP, MAYBE_Listen) { |
| 588 sockaddr_in addr; | 596 sockaddr_in addr; |
| 589 socklen_t addrlen = sizeof(addr); | 597 socklen_t addrlen = sizeof(addr); |
| 590 const char* client_greeting = "hello"; | 598 const char* client_greeting = "hello"; |
| 591 const char* server_reply = "reply"; | 599 const char* server_reply = "reply"; |
| 592 const int greeting_len = strlen(client_greeting); | 600 const int greeting_len = strlen(client_greeting); |
| 593 const int reply_len = strlen(server_reply); | 601 const int reply_len = strlen(server_reply); |
| 594 | 602 |
| 595 int server_sock = sock1_; | 603 int server_sock = sock1_; |
| 596 | 604 |
| 597 // Accept before listen should fail | 605 // Accept before listen should fail |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 806 while (remainder > 0) { | 814 while (remainder > 0) { |
| 807 int rtn = ki_recv(new_sock, buffer, remainder, 0); | 815 int rtn = ki_recv(new_sock, buffer, remainder, 0); |
| 808 ASSERT_GT(rtn, 0); | 816 ASSERT_GT(rtn, 0); |
| 809 remainder -= rtn; | 817 remainder -= rtn; |
| 810 } | 818 } |
| 811 | 819 |
| 812 ASSERT_EQ(0, ki_close(new_sock)); | 820 ASSERT_EQ(0, ki_close(new_sock)); |
| 813 } | 821 } |
| 814 | 822 |
| 815 #endif // PROVIDES_SOCKET_API | 823 #endif // PROVIDES_SOCKET_API |
| OLD | NEW |