OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2011 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. | |
4 | |
5 #ifndef PPAPI_TESTS_TEST_TCP_SOCKET_PRIVATE_SHARED_H_ | |
polina
2011/11/29 05:20:47
I am pretty sure the reviewers of the other CL wou
ygorshenin
2011/11/29 13:25:18
After moving it to the chrome CL we'll lost all hi
| |
6 #define PPAPI_TESTS_TEST_TCP_SOCKET_PRIVATE_SHARED_H_ | |
7 | |
8 #include "ppapi/c/pp_stdint.h" | |
9 #include "ppapi/cpp/private/tcp_socket_private.h" | |
10 #include "ppapi/tests/test_case.h" | |
11 | |
12 class TestTCPSocketPrivateShared : public TestCase { | |
polina
2011/11/29 05:20:47
Why "Shared" at the end?
ygorshenin
2011/11/29 13:25:18
Because of there already exists class with name "T
| |
13 public: | |
14 explicit TestTCPSocketPrivateShared(TestingInstance* instance) | |
15 : TestCase(instance) { | |
polina
2011/11/29 05:20:47
you should initialize member variables here (in .c
ygorshenin
2011/11/29 13:25:18
Done.
| |
16 } | |
17 | |
18 // TestCase implementation. | |
19 virtual bool Init(); | |
20 virtual void RunTests(const std::string& filter); | |
21 | |
22 void QuitMessageLoop(); | |
23 | |
24 private: | |
25 bool InitHostAndPort(); | |
26 | |
27 std::string CreateSocket(PP_Resource* socket); | |
28 std::string SyncConnect(PP_Resource socket, const char* host, int port); | |
29 std::string SyncConnectWithNetAddress(PP_Resource socket, | |
30 const PP_NetAddress_Private& addr); | |
31 std::string SyncSSLHandshake(PP_Resource socket, const char* host, int port); | |
32 std::string SyncRead(PP_Resource socket, char* buffer, int32_t num_bytes, | |
33 int32_t* bytes_read); | |
34 std::string SyncWrite(PP_Resource socket, const char* buffer, | |
35 int32_t num_bytes, int32_t* bytes_wrote); | |
36 std::string CheckHTTPResponse(PP_Resource socket, const char* request, | |
37 const char* response); | |
38 | |
39 std::string TestCreate(); | |
40 std::string TestGetAddress(); | |
41 std::string TestConnect(); | |
42 std::string TestReconnect(); | |
43 | |
44 std::string host_; | |
45 uint16_t port_; | |
46 const PPB_TCPSocket_Private* tcp_socket_private_interface_; | |
47 }; | |
48 | |
49 #endif // PPAPI_TESTS_TEST_TCP_SOCKET_PRIVATE_SHARED_H_ | |
OLD | NEW |