QUIC - cleanup changes to sync chromium tree with internal source.
[chromium-blink-merge.git] / ppapi / tests / test_host_resolver_private.h
blob52f1f27abf2f2200865c28d61c67da2d12ab8bc1
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.
5 #ifndef PPAPI_TESTS_TEST_HOST_RESOLVER_PRIVATE_H_
6 #define PPAPI_TESTS_TEST_HOST_RESOLVER_PRIVATE_H_
8 #include <string>
10 #include "ppapi/tests/test_case.h"
12 struct PP_HostResolver_Private_Hint;
13 struct PP_NetAddress_Private;
15 namespace pp {
17 class HostResolverPrivate;
18 class TCPSocketPrivate;
20 } // namespace pp
22 class TestHostResolverPrivate : public TestCase {
23 public:
24 explicit TestHostResolverPrivate(TestingInstance* instance);
26 // TestCase implementation.
27 virtual bool Init();
28 virtual void RunTests(const std::string& filter);
30 private:
31 std::string SyncConnect(pp::TCPSocketPrivate* socket,
32 const std::string& host,
33 uint16_t port);
34 std::string SyncConnect(pp::TCPSocketPrivate* socket,
35 const PP_NetAddress_Private& address);
36 std::string SyncRead(pp::TCPSocketPrivate* socket,
37 char* buffer,
38 int32_t num_bytes,
39 int32_t* bytes_read);
40 std::string SyncWrite(pp::TCPSocketPrivate* socket,
41 const char* buffer,
42 int32_t num_bytes,
43 int32_t* bytes_written);
44 std::string CheckHTTPResponse(pp::TCPSocketPrivate* socket,
45 const std::string& request,
46 const std::string& response);
47 std::string SyncResolve(pp::HostResolverPrivate* host_resolver,
48 const std::string& host,
49 uint16_t port,
50 const PP_HostResolver_Private_Hint& hint);
51 std::string ParametrizedTestResolve(const PP_HostResolver_Private_Hint& hint);
53 std::string TestEmpty();
54 std::string TestResolve();
55 std::string TestResolveIPv4();
57 std::string host_;
58 uint16_t port_;
61 #endif // PPAPI_TESTS_TEST_HOST_RESOLVER_PRIVATE_H_