| 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_tcp_socket_private_disallowed.h" | 5 #include "ppapi/tests/test_tcp_socket_private_disallowed.h" |
| 6 | 6 |
| 7 #include "ppapi/cpp/module.h" | 7 #include "ppapi/cpp/module.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 21 matching lines...) Expand all Loading... |
| 32 | 32 |
| 33 void TestTCPSocketPrivateDisallowed::RunTests(const std::string& filter) { | 33 void TestTCPSocketPrivateDisallowed::RunTests(const std::string& filter) { |
| 34 RUN_TEST(Connect, filter); | 34 RUN_TEST(Connect, filter); |
| 35 } | 35 } |
| 36 | 36 |
| 37 std::string TestTCPSocketPrivateDisallowed::TestConnect() { | 37 std::string TestTCPSocketPrivateDisallowed::TestConnect() { |
| 38 PP_Resource socket = | 38 PP_Resource socket = |
| 39 tcp_socket_private_interface_->Create(instance_->pp_instance()); | 39 tcp_socket_private_interface_->Create(instance_->pp_instance()); |
| 40 if (0 != socket) { | 40 if (0 != socket) { |
| 41 TestCompletionCallback callback(instance_->pp_instance()); | 41 TestCompletionCallback callback(instance_->pp_instance()); |
| 42 int32_t rv = tcp_socket_private_interface_->Connect( | 42 callback.WaitForResult(tcp_socket_private_interface_->Connect( |
| 43 socket, kServerName, kPort, | 43 socket, kServerName, kPort, |
| 44 callback.GetCallback().pp_completion_callback()); | 44 callback.GetCallback().pp_completion_callback())); |
| 45 | 45 CHECK_CALLBACK_BEHAVIOR(callback); |
| 46 if (PP_OK_COMPLETIONPENDING == rv) | 46 ASSERT_EQ(PP_ERROR_FAILED, callback.result()); |
| 47 rv = callback.WaitForResult(); | |
| 48 | |
| 49 if (PP_ERROR_FAILED != rv) | |
| 50 return "PPB_TCPSocket_Private can connect without allowing switch"; | |
| 51 } | 47 } |
| 52 PASS(); | 48 PASS(); |
| 53 } | 49 } |
| OLD | NEW |