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

Side by Side Diff: ppapi/tests/test_tcp_socket.cc

Issue 17419008: Move PPB_NetAddress out of dev. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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
« no previous file with comments | « ppapi/tests/test_tcp_socket.h ('k') | ppapi/tests/test_udp_socket.h » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "ppapi/tests/test_tcp_socket.h" 5 #include "ppapi/tests/test_tcp_socket.h"
6 6
7 #include "ppapi/cpp/dev/tcp_socket_dev.h" 7 #include "ppapi/cpp/dev/tcp_socket_dev.h"
8 #include "ppapi/tests/test_utils.h" 8 #include "ppapi/tests/test_utils.h"
9 #include "ppapi/tests/testing_instance.h" 9 #include "ppapi/tests/testing_instance.h"
10 10
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 } 52 }
53 53
54 std::string TestTCPSocket::TestConnect() { 54 std::string TestTCPSocket::TestConnect() {
55 pp::TCPSocket_Dev socket(instance_); 55 pp::TCPSocket_Dev socket(instance_);
56 TestCompletionCallback cb(instance_->pp_instance(), callback_type()); 56 TestCompletionCallback cb(instance_->pp_instance(), callback_type());
57 57
58 cb.WaitForResult(socket.Connect(addr_, cb.GetCallback())); 58 cb.WaitForResult(socket.Connect(addr_, cb.GetCallback()));
59 CHECK_CALLBACK_BEHAVIOR(cb); 59 CHECK_CALLBACK_BEHAVIOR(cb);
60 ASSERT_EQ(PP_OK, cb.result()); 60 ASSERT_EQ(PP_OK, cb.result());
61 61
62 pp::NetAddress_Dev local_addr, remote_addr; 62 pp::NetAddress local_addr, remote_addr;
63 local_addr = socket.GetLocalAddress(); 63 local_addr = socket.GetLocalAddress();
64 remote_addr = socket.GetRemoteAddress(); 64 remote_addr = socket.GetRemoteAddress();
65 65
66 ASSERT_NE(0, local_addr.pp_resource()); 66 ASSERT_NE(0, local_addr.pp_resource());
67 ASSERT_NE(0, remote_addr.pp_resource()); 67 ASSERT_NE(0, remote_addr.pp_resource());
68 ASSERT_TRUE(EqualNetAddress(addr_, remote_addr)); 68 ASSERT_TRUE(EqualNetAddress(addr_, remote_addr));
69 69
70 socket.Close(); 70 socket.Close();
71 71
72 PASS(); 72 PASS();
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 if (cb.result() < 0) 182 if (cb.result() < 0)
183 return cb.result(); 183 return cb.result();
184 if (cb.result() == 0) 184 if (cb.result() == 0)
185 return PP_ERROR_FAILED; 185 return PP_ERROR_FAILED;
186 written += cb.result(); 186 written += cb.result();
187 } 187 }
188 if (written != s.size()) 188 if (written != s.size())
189 return PP_ERROR_FAILED; 189 return PP_ERROR_FAILED;
190 return PP_OK; 190 return PP_OK;
191 } 191 }
OLDNEW
« no previous file with comments | « ppapi/tests/test_tcp_socket.h ('k') | ppapi/tests/test_udp_socket.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698