| 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 <cstdio> |
| 8 |
| 7 #include "ppapi/cpp/module.h" | 9 #include "ppapi/cpp/module.h" |
| 8 #include "ppapi/tests/test_utils.h" | 10 #include "ppapi/tests/test_utils.h" |
| 9 #include "ppapi/tests/testing_instance.h" | 11 #include "ppapi/tests/testing_instance.h" |
| 10 | 12 |
| 11 namespace { | 13 namespace { |
| 12 | 14 |
| 13 const char kServerName[] = "www.google.com"; | 15 const char kServerName[] = "www.google.com"; |
| 14 const int kPort = 80; | 16 const int kPort = 80; |
| 15 | 17 |
| 16 } | 18 } |
| (...skipping 19 matching lines...) Expand all Loading... |
| 36 | 38 |
| 37 std::string TestTCPSocketPrivateDisallowed::TestConnect() { | 39 std::string TestTCPSocketPrivateDisallowed::TestConnect() { |
| 38 PP_Resource socket = | 40 PP_Resource socket = |
| 39 tcp_socket_private_interface_->Create(instance_->pp_instance()); | 41 tcp_socket_private_interface_->Create(instance_->pp_instance()); |
| 40 if (0 != socket) { | 42 if (0 != socket) { |
| 41 TestCompletionCallback callback(instance_->pp_instance()); | 43 TestCompletionCallback callback(instance_->pp_instance()); |
| 42 callback.WaitForResult(tcp_socket_private_interface_->Connect( | 44 callback.WaitForResult(tcp_socket_private_interface_->Connect( |
| 43 socket, kServerName, kPort, | 45 socket, kServerName, kPort, |
| 44 callback.GetCallback().pp_completion_callback())); | 46 callback.GetCallback().pp_completion_callback())); |
| 45 CHECK_CALLBACK_BEHAVIOR(callback); | 47 CHECK_CALLBACK_BEHAVIOR(callback); |
| 48 fprintf(stderr, "Result=%d\n", (int) callback.result()); |
| 46 ASSERT_EQ(PP_ERROR_FAILED, callback.result()); | 49 ASSERT_EQ(PP_ERROR_FAILED, callback.result()); |
| 47 } | 50 } |
| 48 PASS(); | 51 PASS(); |
| 49 } | 52 } |
| OLD | NEW |