| OLD | NEW |
| 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_udp_socket_private_disallowed.h" | 5 #include "ppapi/tests/test_udp_socket_private_disallowed.h" |
| 6 | 6 |
| 7 #include "ppapi/cpp/module.h" | 7 #include "ppapi/cpp/module.h" |
| 8 #include "ppapi/cpp/private/net_address_private.h" | 8 #include "ppapi/cpp/private/net_address_private.h" |
| 9 #include "ppapi/tests/testing_instance.h" | 9 #include "ppapi/tests/testing_instance.h" |
| 10 #include "ppapi/tests/test_utils.h" | 10 #include "ppapi/tests/test_utils.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 } | 29 } |
| 30 | 30 |
| 31 std::string TestUDPSocketPrivateDisallowed::TestBind() { | 31 std::string TestUDPSocketPrivateDisallowed::TestBind() { |
| 32 PP_Resource socket = | 32 PP_Resource socket = |
| 33 udp_socket_private_interface_->Create(instance_->pp_instance()); | 33 udp_socket_private_interface_->Create(instance_->pp_instance()); |
| 34 if (0 != socket) { | 34 if (0 != socket) { |
| 35 PP_NetAddress_Private addr; | 35 PP_NetAddress_Private addr; |
| 36 pp::NetAddressPrivate::GetAnyAddress(false, &addr); | 36 pp::NetAddressPrivate::GetAnyAddress(false, &addr); |
| 37 | 37 |
| 38 TestCompletionCallback callback(instance_->pp_instance()); | 38 TestCompletionCallback callback(instance_->pp_instance()); |
| 39 int32_t rv = udp_socket_private_interface_->Bind(socket, &addr, | 39 callback.WaitForResult(udp_socket_private_interface_->Bind(socket, &addr, |
| 40 callback.GetCallback().pp_completion_callback()); | 40 callback.GetCallback().pp_completion_callback())); |
| 41 | 41 CHECK_CALLBACK_BEHAVIOR(callback); |
| 42 if (PP_OK_COMPLETIONPENDING == rv) | 42 ASSERT_EQ(PP_ERROR_FAILED, callback.result()); |
| 43 rv = callback.WaitForResult(); | |
| 44 | |
| 45 if (PP_ERROR_FAILED != rv) | |
| 46 return "PPB_UDPSocket_Private can bind without allowing switch"; | |
| 47 } | 43 } |
| 48 PASS(); | 44 PASS(); |
| 49 } | 45 } |
| OLD | NEW |