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

Unified Diff: ppapi/tests/test_udp_socket.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: Rebase and fixed implementation. Created 6 years 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 side-by-side diff with in-line comments
Download patch
Index: ppapi/tests/test_udp_socket.cc
diff --git a/ppapi/tests/test_udp_socket.cc b/ppapi/tests/test_udp_socket.cc
index e0b76f47728b3ae9100378f9f5fe42b57ebdeb30..8972e4e94385efc53fc5e3112dca417ddc4e7623 100644
--- a/ppapi/tests/test_udp_socket.cc
+++ b/ppapi/tests/test_udp_socket.cc
@@ -272,36 +272,35 @@ std::string TestUDPSocket::TestSetOption() {
CHECK_CALLBACK_BEHAVIOR(callback);
ASSERT_EQ(PP_OK, callback.result());
- // SEND_BUFFER_SIZE and RECV_BUFFER_SIZE shouldn't be set before the socket is
- // bound.
callback.WaitForResult(socket.SetOption(
PP_UDPSOCKET_OPTION_SEND_BUFFER_SIZE, pp::Var(4096),
callback.GetCallback()));
CHECK_CALLBACK_BEHAVIOR(callback);
- ASSERT_EQ(PP_ERROR_FAILED, callback.result());
+ ASSERT_EQ(PP_OK, callback.result());
callback.WaitForResult(socket.SetOption(
PP_UDPSOCKET_OPTION_RECV_BUFFER_SIZE, pp::Var(512),
callback.GetCallback()));
CHECK_CALLBACK_BEHAVIOR(callback);
- ASSERT_EQ(PP_ERROR_FAILED, callback.result());
+ ASSERT_EQ(PP_OK, callback.result());
pp::NetAddress address;
ASSERT_SUBTEST_SUCCESS(LookupPortAndBindUDPSocket(&socket, &address));
- // ADDRESS_REUSE and BROADCAST won't take effect after the socket is bound.
+ // ADDRESS_REUSE won't take effect after the socket is bound.
callback.WaitForResult(socket.SetOption(
PP_UDPSOCKET_OPTION_ADDRESS_REUSE, pp::Var(true),
callback.GetCallback()));
CHECK_CALLBACK_BEHAVIOR(callback);
ASSERT_EQ(PP_ERROR_FAILED, callback.result());
+ // BROADCAST, SEND_BUFFER_SIZE and RECV_BUFFER_SIZE can be set after the
+ // socket is bound.
callback.WaitForResult(socket.SetOption(
PP_UDPSOCKET_OPTION_BROADCAST, pp::Var(true), callback.GetCallback()));
CHECK_CALLBACK_BEHAVIOR(callback);
- ASSERT_EQ(PP_ERROR_FAILED, callback.result());
+ ASSERT_EQ(PP_OK, callback.result());
- // SEND_BUFFER_SIZE and RECV_BUFFER_SIZE can be set after the socket is bound.
callback.WaitForResult(socket.SetOption(
PP_UDPSOCKET_OPTION_SEND_BUFFER_SIZE, pp::Var(2048),
callback.GetCallback()));

Powered by Google App Engine
This is Rietveld 408576698