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_UDP_SOCKET_PRIVATE_SHARED_H_ | |
6 #define PPAPI_TESTS_TEST_UDP_SOCKET_PRIVATE_SHARED_H_ | |
7 | |
8 #include "ppapi/cpp/private/tcp_socket_private.h" | |
9 #include "ppapi/cpp/private/udp_socket_private.h" | |
10 #include "ppapi/tests/test_case.h" | |
11 | |
12 class TestUDPSocketPrivateShared : public TestCase { | |
13 public: | |
14 explicit TestUDPSocketPrivateShared(TestingInstance* instance); | |
15 | |
16 // TestCase implementation. | |
17 virtual bool Init(); | |
18 virtual void RunTests(const std::string& filter); | |
19 | |
20 void QuitMessageLoop(); | |
21 | |
22 private: | |
23 static const char* const kHost; | |
24 static const int kPort = 80; | |
25 | |
26 // Creates tcp_socket and connects to www.google.com:80. After that, | |
27 // stores into |address| local address and returns created | |
28 // tcp_socket. This is a way to create |PP_NetAddress_Private| | |
29 // structure filled with local IP and some free port. | |
30 std::string GenerateNetAddress(PP_Resource* socket, | |
31 PP_NetAddress_Private* address); | |
32 std::string CreateAndBindUDPSocket(const PP_NetAddress_Private *address, | |
33 PP_Resource *socket); | |
34 | |
35 std::string TestCreate(); | |
36 std::string TestConnect(); | |
37 | |
38 const PPB_TCPSocket_Private* tcp_socket_private_interface_; | |
39 const PPB_UDPSocket_Private* udp_socket_private_interface_; | |
40 }; | |
41 | |
42 #endif // PPAPI_TESTS_TEST_UDP_SOCKET_PRIVATE_SHARED_H_ | |
OLD | NEW |