Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(111)

Unified Diff: ppapi/tests/test_tcp_server_socket_private.h

Issue 9283022: Exposed Listen and Accept methods to plugin. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Sync. Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ppapi/shared_impl/resource.h ('k') | ppapi/tests/test_tcp_server_socket_private.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/tests/test_tcp_server_socket_private.h
diff --git a/ppapi/tests/test_tcp_server_socket_private.h b/ppapi/tests/test_tcp_server_socket_private.h
new file mode 100644
index 0000000000000000000000000000000000000000..5ada1c1c089cc8b6620c81ac710e59416eaa031a
--- /dev/null
+++ b/ppapi/tests/test_tcp_server_socket_private.h
@@ -0,0 +1,56 @@
+// 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_TCP_SERVER_SOCKET_PRIVATE_H_
+#define PPAPI_TESTS_TEST_TCP_SERVER_SOCKET_PRIVATE_H_
+
+#include <string>
+
+#include "ppapi/c/pp_stdint.h"
+#include "ppapi/c/ppb_core.h"
+#include "ppapi/c/private/ppb_net_address_private.h"
+#include "ppapi/c/private/ppb_tcp_server_socket_private.h"
+#include "ppapi/c/private/ppb_tcp_socket_private.h"
+#include "ppapi/tests/test_case.h"
+
+class TestTCPServerSocketPrivate : public TestCase {
+ public:
+ explicit TestTCPServerSocketPrivate(TestingInstance* instance);
+
+ // TestCase implementation.
+ virtual bool Init();
+ virtual void RunTests(const std::string& filter);
+
+ private:
+ std::string GetLocalAddress(PP_NetAddress_Private* address);
+ std::string SyncRead(PP_Resource socket, char* buffer, int32_t num_bytes);
+ std::string SyncWrite(PP_Resource socket,
+ const char* buffer,
+ int32_t num_bytes);
+ std::string SyncConnect(PP_Resource socket, const char* host, uint16_t port);
+ void ForceConnect(PP_Resource socket, const char* host, uint16_t port);
+ std::string SyncListen(PP_Resource socket, uint16_t* port, int32_t backlog);
+
+ bool IsSocketsConnected(PP_Resource lhs, PP_Resource rhs);
+ std::string SendMessage(PP_Resource dst,
+ PP_Resource src,
+ const char* message);
+ std::string TestConnectedSockets(PP_Resource lhs, PP_Resource rhs);
+
+ std::string CheckIOOfConnectedSockets(PP_Resource src, PP_Resource dst);
+ std::string CheckAddressesOfConnectedSockets(PP_Resource lhs,
+ PP_Resource rhs);
+
+ std::string TestCreate();
+ std::string TestListen();
+ std::string TestBacklog();
+
+ const PPB_Core* core_interface_;
+ const PPB_TCPServerSocket_Private* tcp_server_socket_private_interface_;
+ const PPB_TCPSocket_Private* tcp_socket_private_interface_;
+ std::string host_;
+ uint16_t port_;
+};
+
+#endif // PPAPI_TESTS_TEST_TCP_SERVER_SOCKET_PRIVATE_H_
« no previous file with comments | « ppapi/shared_impl/resource.h ('k') | ppapi/tests/test_tcp_server_socket_private.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698