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

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

Issue 17615004: Add "PRIVATE" to the enum names of some private Pepper networking APIs: (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_network_monitor_private.cc ('k') | ppapi/tests/test_udp_socket_private.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 #include "ppapi/tests/test_tcp_socket_private.h" 5 #include "ppapi/tests/test_tcp_socket_private.h"
6 6
7 #include <stdlib.h> 7 #include <stdlib.h>
8 8
9 #include "ppapi/cpp/private/tcp_socket_private.h" 9 #include "ppapi/cpp/private/tcp_socket_private.h"
10 #include "ppapi/tests/testing_instance.h" 10 #include "ppapi/tests/testing_instance.h"
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 socket.Disconnect(); 148 socket.Disconnect();
149 149
150 PASS(); 150 PASS();
151 } 151 }
152 152
153 std::string TestTCPSocketPrivate::TestSetOption() { 153 std::string TestTCPSocketPrivate::TestSetOption() {
154 pp::TCPSocketPrivate socket(instance_); 154 pp::TCPSocketPrivate socket(instance_);
155 TestCompletionCallback cb(instance_->pp_instance(), callback_type()); 155 TestCompletionCallback cb(instance_->pp_instance(), callback_type());
156 156
157 cb.WaitForResult( 157 cb.WaitForResult(
158 socket.SetOption(PP_TCPSOCKETOPTION_NO_DELAY, true, cb.GetCallback())); 158 socket.SetOption(PP_TCPSOCKETOPTION_PRIVATE_NO_DELAY, true,
159 cb.GetCallback()));
159 CHECK_CALLBACK_BEHAVIOR(cb); 160 CHECK_CALLBACK_BEHAVIOR(cb);
160 ASSERT_EQ(PP_ERROR_FAILED, cb.result()); 161 ASSERT_EQ(PP_ERROR_FAILED, cb.result());
161 162
162 cb.WaitForResult(socket.Connect(host_.c_str(), port_, cb.GetCallback())); 163 cb.WaitForResult(socket.Connect(host_.c_str(), port_, cb.GetCallback()));
163 CHECK_CALLBACK_BEHAVIOR(cb); 164 CHECK_CALLBACK_BEHAVIOR(cb);
164 ASSERT_EQ(PP_OK, cb.result()); 165 ASSERT_EQ(PP_OK, cb.result());
165 166
166 cb.WaitForResult( 167 cb.WaitForResult(
167 socket.SetOption(PP_TCPSOCKETOPTION_NO_DELAY, true, cb.GetCallback())); 168 socket.SetOption(PP_TCPSOCKETOPTION_PRIVATE_NO_DELAY, true,
169 cb.GetCallback()));
168 CHECK_CALLBACK_BEHAVIOR(cb); 170 CHECK_CALLBACK_BEHAVIOR(cb);
169 ASSERT_EQ(PP_OK, cb.result()); 171 ASSERT_EQ(PP_OK, cb.result());
170 172
171 cb.WaitForResult( 173 cb.WaitForResult(
172 socket.SetOption(PP_TCPSOCKETOPTION_INVALID, true, cb.GetCallback())); 174 socket.SetOption(PP_TCPSOCKETOPTION_PRIVATE_INVALID, true,
175 cb.GetCallback()));
173 CHECK_CALLBACK_BEHAVIOR(cb); 176 CHECK_CALLBACK_BEHAVIOR(cb);
174 ASSERT_EQ(PP_ERROR_BADARGUMENT, cb.result()); 177 ASSERT_EQ(PP_ERROR_BADARGUMENT, cb.result());
175 178
176 socket.Disconnect(); 179 socket.Disconnect();
177 180
178 PASS(); 181 PASS();
179 } 182 }
180 183
181 int32_t TestTCPSocketPrivate::ReadFirstLineFromSocket( 184 int32_t TestTCPSocketPrivate::ReadFirstLineFromSocket(
182 pp::TCPSocketPrivate* socket, 185 pp::TCPSocketPrivate* socket,
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 if (cb.result() < 0) 222 if (cb.result() < 0)
220 return cb.result(); 223 return cb.result();
221 if (cb.result() == 0) 224 if (cb.result() == 0)
222 return PP_ERROR_FAILED; 225 return PP_ERROR_FAILED;
223 written += cb.result(); 226 written += cb.result();
224 } 227 }
225 if (written != s.size()) 228 if (written != s.size())
226 return PP_ERROR_FAILED; 229 return PP_ERROR_FAILED;
227 return PP_OK; 230 return PP_OK;
228 } 231 }
OLDNEW
« no previous file with comments | « ppapi/tests/test_network_monitor_private.cc ('k') | ppapi/tests/test_udp_socket_private.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698