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

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

Issue 10491007: fixed issue 128383 - replace GetPeerAddress(AddressList* address) with GetPeerAddress(IPEndPoint* a… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix according to review Created 8 years, 6 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 | Annotate | Revision Log
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 #include "net/socket/tcp_server_socket.h" 5 #include "net/socket/tcp_server_socket.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 52
53 void ParseAddress(std::string ip_str, int port, IPEndPoint* address) { 53 void ParseAddress(std::string ip_str, int port, IPEndPoint* address) {
54 IPAddressNumber ip_number; 54 IPAddressNumber ip_number;
55 bool rv = ParseIPLiteralToNumber(ip_str, &ip_number); 55 bool rv = ParseIPLiteralToNumber(ip_str, &ip_number);
56 if (!rv) 56 if (!rv)
57 return; 57 return;
58 *address = IPEndPoint(ip_number, port); 58 *address = IPEndPoint(ip_number, port);
59 } 59 }
60 60
61 static IPEndPoint GetPeerAddress(StreamSocket* socket) { 61 static IPEndPoint GetPeerAddress(StreamSocket* socket) {
62 AddressList address; 62 IPEndPoint address;
63 EXPECT_EQ(OK, socket->GetPeerAddress(&address)); 63 EXPECT_EQ(OK, socket->GetPeerAddress(&address));
64 return address.front(); 64 return address;
65 } 65 }
66 66
67 AddressList local_address_list() const { 67 AddressList local_address_list() const {
68 return AddressList(local_address_); 68 return AddressList(local_address_);
69 } 69 }
70 70
71 TCPServerSocket socket_; 71 TCPServerSocket socket_;
72 IPEndPoint local_address_; 72 IPEndPoint local_address_;
73 }; 73 };
74 74
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 bytes_read += read_result; 244 bytes_read += read_result;
245 } 245 }
246 246
247 std::string received_message(buffer.begin(), buffer.end()); 247 std::string received_message(buffer.begin(), buffer.end());
248 ASSERT_EQ(message, received_message); 248 ASSERT_EQ(message, received_message);
249 } 249 }
250 250
251 } // namespace 251 } // namespace
252 252
253 } // namespace net 253 } // namespace net
OLDNEW
« no previous file with comments | « net/socket/tcp_client_socket_win.cc ('k') | net/socket/transport_client_socket_pool_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698