| 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 #ifndef PPAPI_TESTS_TEST_HOST_RESOLVER_PRIVATE_H_ | 5 #ifndef PPAPI_TESTS_TEST_HOST_RESOLVER_PRIVATE_H_ |
| 6 #define PPAPI_TESTS_TEST_HOST_RESOLVER_PRIVATE_H_ | 6 #define PPAPI_TESTS_TEST_HOST_RESOLVER_PRIVATE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "ppapi/c/ppb_core.h" | |
| 11 #include "ppapi/c/private/ppb_host_resolver_private.h" | |
| 12 #include "ppapi/tests/test_case.h" | 10 #include "ppapi/tests/test_case.h" |
| 13 | 11 |
| 12 struct PP_HostResolver_Private_Hint; |
| 13 struct PP_NetAddress_Private; |
| 14 |
| 14 namespace pp { | 15 namespace pp { |
| 15 | 16 |
| 17 class HostResolverPrivate; |
| 16 class TCPSocketPrivate; | 18 class TCPSocketPrivate; |
| 17 | 19 |
| 18 } // namespace pp | 20 } // namespace pp |
| 19 | 21 |
| 20 class TestHostResolverPrivate : public TestCase { | 22 class TestHostResolverPrivate : public TestCase { |
| 21 public: | 23 public: |
| 22 explicit TestHostResolverPrivate(TestingInstance* instance); | 24 explicit TestHostResolverPrivate(TestingInstance* instance); |
| 23 | 25 |
| 24 // TestCase implementation. | 26 // TestCase implementation. |
| 25 virtual bool Init(); | 27 virtual bool Init(); |
| 26 virtual void RunTests(const std::string& filter); | 28 virtual void RunTests(const std::string& filter); |
| 27 | 29 |
| 28 private: | 30 private: |
| 29 std::string SyncConnect(pp::TCPSocketPrivate* socket, | 31 std::string SyncConnect(pp::TCPSocketPrivate* socket, |
| 30 const std::string& host, | 32 const std::string& host, |
| 31 uint16_t port); | 33 uint16_t port); |
| 32 std::string SyncConnect(pp::TCPSocketPrivate* socket, | 34 std::string SyncConnect(pp::TCPSocketPrivate* socket, |
| 33 const PP_NetAddress_Private& address); | 35 const PP_NetAddress_Private& address); |
| 34 std::string SyncRead(pp::TCPSocketPrivate* socket, | 36 std::string SyncRead(pp::TCPSocketPrivate* socket, |
| 35 char* buffer, | 37 char* buffer, |
| 36 int32_t num_bytes, | 38 int32_t num_bytes, |
| 37 int32_t* bytes_read); | 39 int32_t* bytes_read); |
| 38 std::string SyncWrite(pp::TCPSocketPrivate* socket, | 40 std::string SyncWrite(pp::TCPSocketPrivate* socket, |
| 39 const char* buffer, | 41 const char* buffer, |
| 40 int32_t num_bytes, | 42 int32_t num_bytes, |
| 41 int32_t* bytes_written); | 43 int32_t* bytes_written); |
| 42 std::string CheckHTTPResponse(pp::TCPSocketPrivate* socket, | 44 std::string CheckHTTPResponse(pp::TCPSocketPrivate* socket, |
| 43 const std::string& request, | 45 const std::string& request, |
| 44 const std::string& response); | 46 const std::string& response); |
| 45 std::string SyncResolve(PP_Resource host_resolver, | 47 std::string SyncResolve(pp::HostResolverPrivate* host_resolver, |
| 46 const std::string& host, | 48 const std::string& host, |
| 47 uint16_t port, | 49 uint16_t port, |
| 48 const PP_HostResolver_Private_Hint& hint); | 50 const PP_HostResolver_Private_Hint& hint); |
| 49 std::string ParametrizedTestResolve(const PP_HostResolver_Private_Hint& hint); | 51 std::string ParametrizedTestResolve(const PP_HostResolver_Private_Hint& hint); |
| 50 | 52 |
| 51 std::string TestCreate(); | 53 std::string TestEmpty(); |
| 52 std::string TestResolve(); | 54 std::string TestResolve(); |
| 53 std::string TestResolveIPv4(); | 55 std::string TestResolveIPv4(); |
| 54 | 56 |
| 55 const PPB_Core* core_interface_; | |
| 56 const PPB_HostResolver_Private* host_resolver_private_interface_; | |
| 57 | |
| 58 std::string host_; | 57 std::string host_; |
| 59 uint16_t port_; | 58 uint16_t port_; |
| 60 }; | 59 }; |
| 61 | 60 |
| 62 #endif // PPAPI_TESTS_TEST_HOST_RESOLVER_PRIVATE_H_ | 61 #endif // PPAPI_TESTS_TEST_HOST_RESOLVER_PRIVATE_H_ |
| OLD | NEW |