Index: net/socket/udp_socket_unittest.cc |
diff --git a/net/socket/udp_socket_unittest.cc b/net/socket/udp_socket_unittest.cc |
index 1a602125766aa3885adc848b5ac23d5a24b18555..e1116e0ff9981f0f876441c2612ff251c0ce8972 100644 |
--- a/net/socket/udp_socket_unittest.cc |
+++ b/net/socket/udp_socket_unittest.cc |
@@ -146,9 +146,7 @@ class UDPSocketTest : public PlatformTest { |
} |
// Run unit test for a connection test. |
- // |use_nonblocking_io| is used to switch between overlapped and non-blocking |
- // IO on Windows. It has no effect in other ports. |
- void ConnectTest(bool use_nonblocking_io); |
+ void ConnectTest(); |
protected: |
static const int kMaxRead = 1024; |
@@ -161,7 +159,7 @@ void ReadCompleteCallback(int* result_out, base::Closure callback, int result) { |
callback.Run(); |
} |
-void UDPSocketTest::ConnectTest(bool use_nonblocking_io) { |
+TEST_F(UDPSocketTest, Connect) { |
const uint16_t kPort = 9999; |
std::string simple_message("hello world!"); |
@@ -171,8 +169,6 @@ void UDPSocketTest::ConnectTest(bool use_nonblocking_io) { |
TestNetLog server_log; |
std::unique_ptr<UDPServerSocket> server( |
new UDPServerSocket(&server_log, NetLogSource())); |
- if (use_nonblocking_io) |
- server->UseNonBlockingIO(); |
server->AllowAddressReuse(); |
int rv = server->Listen(bind_address); |
ASSERT_THAT(rv, IsOk()); |
@@ -184,8 +180,6 @@ void UDPSocketTest::ConnectTest(bool use_nonblocking_io) { |
std::unique_ptr<UDPClientSocket> client( |
new UDPClientSocket(DatagramSocket::DEFAULT_BIND, RandIntCallback(), |
&client_log, NetLogSource())); |
- if (use_nonblocking_io) |
- client->UseNonBlockingIO(); |
rv = client->Connect(server_address); |
EXPECT_THAT(rv, IsOk()); |
@@ -268,17 +262,6 @@ void UDPSocketTest::ConnectTest(bool use_nonblocking_io) { |
LogContainsEndEvent(client_entries, 6, NetLogEventType::SOCKET_ALIVE)); |
} |
-TEST_F(UDPSocketTest, Connect) { |
- // The variable |use_nonblocking_io| has no effect in non-Windows ports. |
- ConnectTest(false); |
-} |
- |
-#if defined(OS_WIN) |
-TEST_F(UDPSocketTest, ConnectNonBlocking) { |
- ConnectTest(true); |
-} |
-#endif |
- |
#if defined(OS_MACOSX) |
// UDPSocketPrivate_Broadcast is disabled for OSX because it requires |
// root permissions on OSX 10.7+. |