summaryrefslogtreecommitdiffstats
path: root/ppapi/tests/test_udp_socket_private.h
diff options
context:
space:
mode:
Diffstat (limited to 'ppapi/tests/test_udp_socket_private.h')
-rw-r--r--ppapi/tests/test_udp_socket_private.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/ppapi/tests/test_udp_socket_private.h b/ppapi/tests/test_udp_socket_private.h
new file mode 100644
index 0000000..45cd642
--- /dev/null
+++ b/ppapi/tests/test_udp_socket_private.h
@@ -0,0 +1,42 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef PPAPI_TESTS_TEST_UDP_SOCKET_PRIVATE_H_
+#define PPAPI_TESTS_TEST_UDP_SOCKET_PRIVATE_H_
+
+#include "ppapi/cpp/private/tcp_socket_private.h"
+#include "ppapi/cpp/private/udp_socket_private.h"
+#include "ppapi/tests/test_case.h"
+
+class TestUDPSocketPrivate : public TestCase {
+ public:
+ explicit TestUDPSocketPrivate(TestingInstance* instance);
+
+ // TestCase implementation.
+ virtual bool Init();
+ virtual void RunTests(const std::string& filter);
+
+ private:
+ // Creates tcp_socket and connects to www.google.com:80. After that,
+ // stores into |address| local address and returns created
+ // tcp_socket. This is a way to create |PP_NetAddress_Private|
+ // structure filled with local IP and some free port.
+ std::string GenerateNetAddress(PP_Resource* socket,
+ PP_NetAddress_Private* address);
+ std::string CreateAndBindUDPSocket(PP_NetAddress_Private *address,
+ PP_Resource *socket);
+ std::string BindUDPSocketFailure(PP_NetAddress_Private *address,
+ PP_Resource *socket);
+
+ std::string TestCreate();
+ std::string TestConnect();
+ std::string TestConnectFailure();
+
+ const PPB_TCPSocket_Private* tcp_socket_private_interface_;
+ const PPB_UDPSocket_Private* udp_socket_private_interface_;
+ std::string host_;
+ uint16_t port_;
+};
+
+#endif // PPAPI_TESTS_TEST_UDP_SOCKET_PRIVATE_H_