| Index: net/socket/udp_socket_perftest.cc
|
| diff --git a/net/socket/udp_socket_perftest.cc b/net/socket/udp_socket_perftest.cc
|
| index 190e157caac92228ecf287504be3639d7d5999d9..3f91895ac6e334075e4f09e9d087bbd553b476b8 100644
|
| --- a/net/socket/udp_socket_perftest.cc
|
| +++ b/net/socket/udp_socket_perftest.cc
|
| @@ -44,9 +44,7 @@ class UDPSocketPerfTest : public PlatformTest {
|
| int num_of_packets,
|
| base::Closure done_callback);
|
|
|
| - // Use non-blocking IO if |use_nonblocking_io| is true. This variable only
|
| - // has effect on Windows.
|
| - void WriteBenchmark(bool use_nonblocking_io);
|
| + void WriteBenchmark();
|
|
|
| protected:
|
| static const int kPacketSize = 1024;
|
| @@ -86,7 +84,8 @@ void UDPSocketPerfTest::WritePacketsToSocket(UDPClientSocket* socket,
|
| }
|
| }
|
|
|
| -void UDPSocketPerfTest::WriteBenchmark(bool use_nonblocking_io) {
|
| +TEST_F(UDPSocketPerfTest, Write) {
|
| + base::PerfTimeLogger timer("UDP_socket_write");
|
| base::MessageLoopForIO message_loop;
|
| const uint16_t kPort = 9999;
|
|
|
| @@ -95,8 +94,6 @@ void UDPSocketPerfTest::WriteBenchmark(bool use_nonblocking_io) {
|
| CreateUDPAddress("127.0.0.1", kPort, &bind_address);
|
| std::unique_ptr<UDPServerSocket> server(
|
| new UDPServerSocket(nullptr, NetLogSource()));
|
| - if (use_nonblocking_io)
|
| - server->UseNonBlockingIO();
|
| int rv = server->Listen(bind_address);
|
| ASSERT_THAT(rv, IsOk());
|
|
|
| @@ -106,8 +103,6 @@ void UDPSocketPerfTest::WriteBenchmark(bool use_nonblocking_io) {
|
| std::unique_ptr<UDPClientSocket> client(
|
| new UDPClientSocket(DatagramSocket::DEFAULT_BIND, RandIntCallback(),
|
| nullptr, NetLogSource()));
|
| - if (use_nonblocking_io)
|
| - client->UseNonBlockingIO();
|
| rv = client->Connect(server_address);
|
| EXPECT_THAT(rv, IsOk());
|
|
|
| @@ -122,16 +117,6 @@ void UDPSocketPerfTest::WriteBenchmark(bool use_nonblocking_io) {
|
| LOG(INFO) << "Write speed: " << packets / 1024 / elapsed << " MB/s";
|
| }
|
|
|
| -TEST_F(UDPSocketPerfTest, Write) {
|
| - base::PerfTimeLogger timer("UDP_socket_write");
|
| - WriteBenchmark(false);
|
| -}
|
| -
|
| -TEST_F(UDPSocketPerfTest, WriteNonBlocking) {
|
| - base::PerfTimeLogger timer("UDP_socket_write_nonblocking");
|
| - WriteBenchmark(true);
|
| -}
|
| -
|
| } // namespace
|
|
|
| } // namespace net
|
|
|