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

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

Issue 690903002: Remove timing limitation of SetOption invocation for PPAPI sockets. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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
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 <new> 9 #include <new>
10 10
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 } 154 }
155 155
156 std::string TestTCPSocketPrivate::TestSetOption() { 156 std::string TestTCPSocketPrivate::TestSetOption() {
157 pp::TCPSocketPrivate socket(instance_); 157 pp::TCPSocketPrivate socket(instance_);
158 TestCompletionCallback cb(instance_->pp_instance(), callback_type()); 158 TestCompletionCallback cb(instance_->pp_instance(), callback_type());
159 159
160 cb.WaitForResult( 160 cb.WaitForResult(
161 socket.SetOption(PP_TCPSOCKETOPTION_PRIVATE_NO_DELAY, true, 161 socket.SetOption(PP_TCPSOCKETOPTION_PRIVATE_NO_DELAY, true,
162 cb.GetCallback())); 162 cb.GetCallback()));
163 CHECK_CALLBACK_BEHAVIOR(cb); 163 CHECK_CALLBACK_BEHAVIOR(cb);
164 ASSERT_EQ(PP_ERROR_FAILED, cb.result()); 164 ASSERT_EQ(PP_OK, cb.result());
165 165
166 cb.WaitForResult(socket.Connect(host_.c_str(), port_, cb.GetCallback())); 166 cb.WaitForResult(socket.Connect(host_.c_str(), port_, cb.GetCallback()));
167 CHECK_CALLBACK_BEHAVIOR(cb); 167 CHECK_CALLBACK_BEHAVIOR(cb);
168 ASSERT_EQ(PP_OK, cb.result()); 168 ASSERT_EQ(PP_OK, cb.result());
169 169
170 cb.WaitForResult( 170 cb.WaitForResult(
171 socket.SetOption(PP_TCPSOCKETOPTION_PRIVATE_NO_DELAY, true, 171 socket.SetOption(PP_TCPSOCKETOPTION_PRIVATE_NO_DELAY, true,
172 cb.GetCallback())); 172 cb.GetCallback()));
173 CHECK_CALLBACK_BEHAVIOR(cb); 173 CHECK_CALLBACK_BEHAVIOR(cb);
174 ASSERT_EQ(PP_OK, cb.result()); 174 ASSERT_EQ(PP_OK, cb.result());
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 if (cb.result() < 0) 254 if (cb.result() < 0)
255 return cb.result(); 255 return cb.result();
256 if (cb.result() == 0) 256 if (cb.result() == 0)
257 return PP_ERROR_FAILED; 257 return PP_ERROR_FAILED;
258 written += cb.result(); 258 written += cb.result();
259 } 259 }
260 if (written != s.size()) 260 if (written != s.size())
261 return PP_ERROR_FAILED; 261 return PP_ERROR_FAILED;
262 return PP_OK; 262 return PP_OK;
263 } 263 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698