Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(394)

Unified Diff: net/socket/transport_client_socket_unittest.cc

Issue 10161005: Add DefaultListenSocket. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix build on Windows Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/server/http_server.cc ('k') | net/tools/fetch/http_listen_socket.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/transport_client_socket_unittest.cc
diff --git a/net/socket/transport_client_socket_unittest.cc b/net/socket/transport_client_socket_unittest.cc
index 9ab9044af1740535e10fc88e1402cbf812afb9ab..74f324270ce15d152b01dfbc29e59d9142341896 100644
--- a/net/socket/transport_client_socket_unittest.cc
+++ b/net/socket/transport_client_socket_unittest.cc
@@ -31,8 +31,10 @@ enum ClientSocketTestTypes {
SCTP
};
+} // namespace
+
class TransportClientSocketTest
- : public ListenSocket::ListenSocketDelegate,
+ : public StreamListenSocket::Delegate,
public ::testing::TestWithParam<ClientSocketTestTypes> {
public:
TransportClientSocketTest()
@@ -45,18 +47,19 @@ class TransportClientSocketTest
~TransportClientSocketTest() {
}
- // Implement ListenSocketDelegate methods
- virtual void DidAccept(ListenSocket* server, ListenSocket* connection) {
+ // Implement StreamListenSocket::Delegate methods
+ virtual void DidAccept(StreamListenSocket* server,
+ StreamListenSocket* connection) {
connected_sock_ = reinterpret_cast<TCPListenSocket*>(connection);
}
- virtual void DidRead(ListenSocket*, const char* str, int len) {
+ virtual void DidRead(StreamListenSocket*, const char* str, int len) {
// TODO(dkegel): this might not be long enough to tickle some bugs.
connected_sock_->Send(kServerReply, arraysize(kServerReply) - 1,
false /* Don't append line feed */);
if (close_server_socket_on_next_send_)
CloseServerSocket();
}
- virtual void DidClose(ListenSocket* sock) {}
+ virtual void DidClose(StreamListenSocket* sock) {}
// Testcase hooks
virtual void SetUp();
@@ -101,7 +104,7 @@ void TransportClientSocketTest::SetUp() {
::testing::TestWithParam<ClientSocketTestTypes>::SetUp();
// Find a free port to listen on
- TCPListenSocket *sock = NULL;
+ scoped_refptr<TCPListenSocket> sock = NULL;
int port;
// Range of ports to listen on. Shouldn't need to try many.
const int kMinPort = 10100;
@@ -111,7 +114,7 @@ void TransportClientSocketTest::SetUp() {
#endif
for (port = kMinPort; port < kMaxPort; port++) {
sock = TCPListenSocket::CreateAndListen("127.0.0.1", port, this);
- if (sock)
+ if (sock.get())
break;
}
ASSERT_TRUE(sock != NULL);
@@ -445,6 +448,4 @@ TEST_P(TransportClientSocketTest, DISABLED_FullDuplex_WriteFirst) {
EXPECT_GE(rv, 0);
}
-} // namespace
-
} // namespace net
« no previous file with comments | « net/server/http_server.cc ('k') | net/tools/fetch/http_listen_socket.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698