| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef PPAPI_TESTS_TEST_TCP_SERVER_SOCKET_PRIVATE_H_ |
| 6 #define PPAPI_TESTS_TEST_TCP_SERVER_SOCKET_PRIVATE_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 #include "ppapi/c/pp_stdint.h" |
| 11 #include "ppapi/c/ppb_core.h" |
| 12 #include "ppapi/c/private/ppb_net_address_private.h" |
| 13 #include "ppapi/c/private/ppb_tcp_server_socket_private.h" |
| 14 #include "ppapi/c/private/ppb_tcp_socket_private.h" |
| 15 #include "ppapi/tests/test_case.h" |
| 16 |
| 17 class TestTCPServerSocketPrivate : public TestCase { |
| 18 public: |
| 19 explicit TestTCPServerSocketPrivate(TestingInstance* instance); |
| 20 |
| 21 // TestCase implementation. |
| 22 virtual bool Init(); |
| 23 virtual void RunTests(const std::string& filter); |
| 24 |
| 25 private: |
| 26 std::string GetLocalAddress(PP_NetAddress_Private* address); |
| 27 std::string SyncRead(PP_Resource socket, char* buffer, int32_t num_bytes); |
| 28 std::string SyncWrite(PP_Resource socket, |
| 29 const char* buffer, |
| 30 int32_t num_bytes); |
| 31 std::string SyncConnect(PP_Resource socket, const char* host, uint16_t port); |
| 32 void ForceConnect(PP_Resource socket, const char* host, uint16_t port); |
| 33 std::string SyncListen(PP_Resource socket, uint16_t* port, int32_t backlog); |
| 34 |
| 35 bool IsSocketsConnected(PP_Resource lhs, PP_Resource rhs); |
| 36 std::string SendMessage(PP_Resource dst, |
| 37 PP_Resource src, |
| 38 const char* message); |
| 39 std::string TestConnectedSockets(PP_Resource lhs, PP_Resource rhs); |
| 40 |
| 41 std::string CheckIOOfConnectedSockets(PP_Resource src, PP_Resource dst); |
| 42 std::string CheckAddressesOfConnectedSockets(PP_Resource lhs, |
| 43 PP_Resource rhs); |
| 44 |
| 45 std::string TestCreate(); |
| 46 std::string TestListen(); |
| 47 std::string TestBacklog(); |
| 48 |
| 49 const PPB_Core* core_interface_; |
| 50 const PPB_TCPServerSocket_Private* tcp_server_socket_private_interface_; |
| 51 const PPB_TCPSocket_Private* tcp_socket_private_interface_; |
| 52 std::string host_; |
| 53 uint16_t port_; |
| 54 }; |
| 55 |
| 56 #endif // PPAPI_TESTS_TEST_TCP_SERVER_SOCKET_PRIVATE_H_ |
| OLD | NEW |