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

Side by Side Diff: net/socket/tcp_client_socket_unittest.cc

Issue 1565303002: Change IPEndpoint::address() to return a net::IPAddress (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase for ChromeOS Created 4 years, 10 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 unified diff | Download patch
« no previous file with comments | « net/socket/socks_client_socket.cc ('k') | net/tools/quic/end_to_end_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // This file contains some tests for TCPClientSocket. 5 // This file contains some tests for TCPClientSocket.
6 // transport_client_socket_unittest.cc contans some other tests that 6 // transport_client_socket_unittest.cc contans some other tests that
7 // are common for TCP and other types of sockets. 7 // are common for TCP and other types of sockets.
8 8
9 #include "net/socket/tcp_client_socket.h" 9 #include "net/socket/tcp_client_socket.h"
10 10
(...skipping 18 matching lines...) Expand all
29 ASSERT_EQ(OK, server.Listen(IPEndPoint(lo_address, 0), 1)); 29 ASSERT_EQ(OK, server.Listen(IPEndPoint(lo_address, 0), 1));
30 IPEndPoint server_address; 30 IPEndPoint server_address;
31 ASSERT_EQ(OK, server.GetLocalAddress(&server_address)); 31 ASSERT_EQ(OK, server.GetLocalAddress(&server_address));
32 32
33 TCPClientSocket socket(AddressList(server_address), NULL, NetLog::Source()); 33 TCPClientSocket socket(AddressList(server_address), NULL, NetLog::Source());
34 34
35 EXPECT_EQ(OK, socket.Bind(IPEndPoint(lo_address, 0))); 35 EXPECT_EQ(OK, socket.Bind(IPEndPoint(lo_address, 0)));
36 36
37 IPEndPoint local_address_result; 37 IPEndPoint local_address_result;
38 EXPECT_EQ(OK, socket.GetLocalAddress(&local_address_result)); 38 EXPECT_EQ(OK, socket.GetLocalAddress(&local_address_result));
39 EXPECT_EQ(lo_address, local_address_result.address()); 39 EXPECT_EQ(lo_address, local_address_result.address().bytes());
40 40
41 TestCompletionCallback connect_callback; 41 TestCompletionCallback connect_callback;
42 EXPECT_EQ(ERR_IO_PENDING, socket.Connect(connect_callback.callback())); 42 EXPECT_EQ(ERR_IO_PENDING, socket.Connect(connect_callback.callback()));
43 43
44 TestCompletionCallback accept_callback; 44 TestCompletionCallback accept_callback;
45 scoped_ptr<StreamSocket> accepted_socket; 45 scoped_ptr<StreamSocket> accepted_socket;
46 int result = server.Accept(&accepted_socket, accept_callback.callback()); 46 int result = server.Accept(&accepted_socket, accept_callback.callback());
47 if (result == ERR_IO_PENDING) 47 if (result == ERR_IO_PENDING)
48 result = accept_callback.WaitForResult(); 48 result = accept_callback.WaitForResult();
49 ASSERT_EQ(OK, result); 49 ASSERT_EQ(OK, result);
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 int result = socket.Connect(connect_callback.callback()); 104 int result = socket.Connect(connect_callback.callback());
105 if (result == ERR_IO_PENDING) 105 if (result == ERR_IO_PENDING)
106 result = connect_callback.WaitForResult(); 106 result = connect_callback.WaitForResult();
107 107
108 EXPECT_NE(OK, result); 108 EXPECT_NE(OK, result);
109 } 109 }
110 110
111 } // namespace 111 } // namespace
112 112
113 } // namespace net 113 } // namespace net
OLDNEW
« no previous file with comments | « net/socket/socks_client_socket.cc ('k') | net/tools/quic/end_to_end_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698