1 // Copyright 2013 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 PAPPI_TESTS_TEST_TCP_SOCKET_H_
6 #define PAPPI_TESTS_TEST_TCP_SOCKET_H_
10 #include "ppapi/c/pp_stdint.h"
11 #include "ppapi/c/ppb_tcp_socket.h"
12 #include "ppapi/cpp/net_address.h"
13 #include "ppapi/tests/test_case.h"
19 class TestTCPSocket
: public TestCase
{
21 explicit TestTCPSocket(TestingInstance
* instance
);
23 // TestCase implementation.
25 virtual void RunTests(const std::string
& filter
);
28 std::string
TestConnect();
29 std::string
TestReadWrite();
30 std::string
TestSetOption();
31 std::string
TestListen();
32 std::string
TestBacklog();
33 std::string
TestInterface_1_0();
35 std::string
ReadFirstLineFromSocket(pp::TCPSocket
* socket
, std::string
* s
);
36 std::string
ReadFirstLineFromSocket_1_0(PP_Resource socket
,
38 std::string
ReadFromSocket(pp::TCPSocket
* socket
,
41 std::string
WriteToSocket(pp::TCPSocket
* socket
, const std::string
& s
);
42 std::string
WriteToSocket_1_0(PP_Resource socket
, const std::string
& s
);
44 std::string
GetAddressToBind(pp::NetAddress
* address
);
45 std::string
StartListen(pp::TCPSocket
* socket
, int32_t backlog
);
49 const PPB_TCPSocket_1_0
* socket_interface_1_0_
;
52 #endif // PAPPI_TESTS_TEST_TCP_SOCKET_H_