[email protected] | 669b283 | 2012-02-21 23:37:12 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
[email protected] | ef5e98e | 2011-12-06 09:49:18 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
3 | // found in the LICENSE file. | ||||
4 | |||||
[email protected] | 8ffeeeb4 | 2012-03-22 00:49:29 | [diff] [blame] | 5 | #ifndef PPAPI_TESTS_TEST_UDP_SOCKET_PRIVATE_H_ |
6 | #define PPAPI_TESTS_TEST_UDP_SOCKET_PRIVATE_H_ | ||||
[email protected] | ef5e98e | 2011-12-06 09:49:18 | [diff] [blame] | 7 | |
[email protected] | d8b0735 | 2012-04-26 09:55:18 | [diff] [blame] | 8 | #include <string> |
9 | |||||
10 | #include "ppapi/c/pp_stdint.h" | ||||
[email protected] | ef5e98e | 2011-12-06 09:49:18 | [diff] [blame] | 11 | #include "ppapi/cpp/private/udp_socket_private.h" |
12 | #include "ppapi/tests/test_case.h" | ||||
13 | |||||
[email protected] | 8ffeeeb4 | 2012-03-22 00:49:29 | [diff] [blame] | 14 | class TestUDPSocketPrivate : public TestCase { |
[email protected] | ef5e98e | 2011-12-06 09:49:18 | [diff] [blame] | 15 | public: |
[email protected] | 8ffeeeb4 | 2012-03-22 00:49:29 | [diff] [blame] | 16 | explicit TestUDPSocketPrivate(TestingInstance* instance); |
[email protected] | ef5e98e | 2011-12-06 09:49:18 | [diff] [blame] | 17 | |
18 | // TestCase implementation. | ||||
19 | virtual bool Init(); | ||||
20 | virtual void RunTests(const std::string& filter); | ||||
21 | |||||
[email protected] | ef5e98e | 2011-12-06 09:49:18 | [diff] [blame] | 22 | private: |
[email protected] | d8b0735 | 2012-04-26 09:55:18 | [diff] [blame] | 23 | std::string GetLocalAddress(PP_NetAddress_Private* address); |
[email protected] | 0addda9 | 2012-08-31 08:55:28 | [diff] [blame] | 24 | std::string SetBroadcastOptions(pp::UDPSocketPrivate* socket); |
[email protected] | d8b0735 | 2012-04-26 09:55:18 | [diff] [blame] | 25 | std::string BindUDPSocket(pp::UDPSocketPrivate* socket, |
26 | PP_NetAddress_Private *address); | ||||
[email protected] | 0addda9 | 2012-08-31 08:55:28 | [diff] [blame] | 27 | std::string LookupPortAndBindUDPSocket(pp::UDPSocketPrivate* socket, |
28 | PP_NetAddress_Private* address); | ||||
[email protected] | d8b0735 | 2012-04-26 09:55:18 | [diff] [blame] | 29 | std::string BindUDPSocketFailure(pp::UDPSocketPrivate* socket, |
30 | PP_NetAddress_Private *address); | ||||
[email protected] | 0addda9 | 2012-08-31 08:55:28 | [diff] [blame] | 31 | std::string ReadSocket(pp::UDPSocketPrivate* socket, |
32 | PP_NetAddress_Private* address, | ||||
33 | size_t size, | ||||
34 | std::string* message); | ||||
35 | std::string PassMessage(pp::UDPSocketPrivate* target, | ||||
36 | pp::UDPSocketPrivate* source, | ||||
37 | PP_NetAddress_Private* address, | ||||
38 | const std::string& message); | ||||
[email protected] | ef5e98e | 2011-12-06 09:49:18 | [diff] [blame] | 39 | |
[email protected] | ef5e98e | 2011-12-06 09:49:18 | [diff] [blame] | 40 | std::string TestConnect(); |
[email protected] | 669b283 | 2012-02-21 23:37:12 | [diff] [blame] | 41 | std::string TestConnectFailure(); |
[email protected] | 0addda9 | 2012-08-31 08:55:28 | [diff] [blame] | 42 | std::string TestBroadcast(); |
43 | std::string TestSetSocketFeatureErrors(); | ||||
[email protected] | ef5e98e | 2011-12-06 09:49:18 | [diff] [blame] | 44 | |
[email protected] | 961e897 | 2011-12-15 15:29:19 | [diff] [blame] | 45 | std::string host_; |
46 | uint16_t port_; | ||||
[email protected] | ef5e98e | 2011-12-06 09:49:18 | [diff] [blame] | 47 | }; |
48 | |||||
[email protected] | 8ffeeeb4 | 2012-03-22 00:49:29 | [diff] [blame] | 49 | #endif // PPAPI_TESTS_TEST_UDP_SOCKET_PRIVATE_H_ |