| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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 "base/ref_counted.h" | 5 #include "base/ref_counted.h" |
| 6 #include "base/trace_event.h" | 6 #include "base/trace_event.h" |
| 7 #include "net/base/address_list.h" | 7 #include "net/base/address_list.h" |
| 8 #include "net/base/host_resolver.h" | 8 #include "net/base/host_resolver.h" |
| 9 #include "net/base/listen_socket.h" | 9 #include "net/base/listen_socket.h" |
| 10 #include "net/base/net_errors.h" | 10 #include "net/base/net_errors.h" |
| 11 #include "net/base/tcp_client_socket.h" | |
| 12 #include "net/base/tcp_pinger.h" | |
| 13 #include "net/base/winsock_init.h" | 11 #include "net/base/winsock_init.h" |
| 12 #include "net/socket/tcp_client_socket.h" |
| 13 #include "net/socket/tcp_pinger.h" |
| 14 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
| 15 #include "testing/platform_test.h" | 15 #include "testing/platform_test.h" |
| 16 | 16 |
| 17 class TCPPingerTest | 17 class TCPPingerTest |
| 18 : public PlatformTest, public ListenSocket::ListenSocketDelegate { | 18 : public PlatformTest, public ListenSocket::ListenSocketDelegate { |
| 19 public: | 19 public: |
| 20 TCPPingerTest() { | 20 TCPPingerTest() { |
| 21 } | 21 } |
| 22 | 22 |
| 23 // Implement ListenSocketDelegate methods | 23 // Implement ListenSocketDelegate methods |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 listen_sock_ = NULL; | 84 listen_sock_ = NULL; |
| 85 | 85 |
| 86 net::HostResolver::RequestInfo info("localhost", listen_port_); | 86 net::HostResolver::RequestInfo info("localhost", listen_port_); |
| 87 int rv = resolver.Resolve(info, &addr, NULL, NULL); | 87 int rv = resolver.Resolve(info, &addr, NULL, NULL); |
| 88 EXPECT_EQ(rv, net::OK); | 88 EXPECT_EQ(rv, net::OK); |
| 89 | 89 |
| 90 net::TCPPinger pinger(addr); | 90 net::TCPPinger pinger(addr); |
| 91 rv = pinger.Ping(base::TimeDelta::FromMilliseconds(100), 1); | 91 rv = pinger.Ping(base::TimeDelta::FromMilliseconds(100), 1); |
| 92 EXPECT_NE(rv, net::OK); | 92 EXPECT_NE(rv, net::OK); |
| 93 } | 93 } |
| OLD | NEW |