OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef PPAPI_TESTS_TEST_UDP_SOCKET_H_ | 5 #ifndef PPAPI_TESTS_TEST_UDP_SOCKET_H_ |
6 #define PPAPI_TESTS_TEST_UDP_SOCKET_H_ | 6 #define PPAPI_TESTS_TEST_UDP_SOCKET_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "ppapi/c/pp_stdint.h" | 10 #include "ppapi/c/pp_stdint.h" |
11 #include "ppapi/cpp/dev/net_address_dev.h" | 11 #include "ppapi/cpp/net_address.h" |
12 #include "ppapi/tests/test_case.h" | 12 #include "ppapi/tests/test_case.h" |
13 | 13 |
14 namespace pp { | 14 namespace pp { |
15 class UDPSocket_Dev; | 15 class UDPSocket_Dev; |
16 } | 16 } |
17 | 17 |
18 class TestUDPSocket: public TestCase { | 18 class TestUDPSocket: public TestCase { |
19 public: | 19 public: |
20 explicit TestUDPSocket(TestingInstance* instance); | 20 explicit TestUDPSocket(TestingInstance* instance); |
21 | 21 |
22 // TestCase implementation. | 22 // TestCase implementation. |
23 virtual bool Init(); | 23 virtual bool Init(); |
24 virtual void RunTests(const std::string& filter); | 24 virtual void RunTests(const std::string& filter); |
25 | 25 |
26 private: | 26 private: |
27 std::string GetLocalAddress(pp::NetAddress_Dev* address); | 27 std::string GetLocalAddress(pp::NetAddress* address); |
28 std::string SetBroadcastOptions(pp::UDPSocket_Dev* socket); | 28 std::string SetBroadcastOptions(pp::UDPSocket_Dev* socket); |
29 std::string BindUDPSocket(pp::UDPSocket_Dev* socket, | 29 std::string BindUDPSocket(pp::UDPSocket_Dev* socket, |
30 const pp::NetAddress_Dev& address); | 30 const pp::NetAddress& address); |
31 std::string LookupPortAndBindUDPSocket(pp::UDPSocket_Dev* socket, | 31 std::string LookupPortAndBindUDPSocket(pp::UDPSocket_Dev* socket, |
32 pp::NetAddress_Dev* address); | 32 pp::NetAddress* address); |
33 std::string ReadSocket(pp::UDPSocket_Dev* socket, | 33 std::string ReadSocket(pp::UDPSocket_Dev* socket, |
34 pp::NetAddress_Dev* address, | 34 pp::NetAddress* address, |
35 size_t size, | 35 size_t size, |
36 std::string* message); | 36 std::string* message); |
37 std::string PassMessage(pp::UDPSocket_Dev* target, | 37 std::string PassMessage(pp::UDPSocket_Dev* target, |
38 pp::UDPSocket_Dev* source, | 38 pp::UDPSocket_Dev* source, |
39 const pp::NetAddress_Dev& target_address, | 39 const pp::NetAddress& target_address, |
40 const std::string& message, | 40 const std::string& message, |
41 pp::NetAddress_Dev* recvfrom_address); | 41 pp::NetAddress* recvfrom_address); |
42 | 42 |
43 std::string TestReadWrite(); | 43 std::string TestReadWrite(); |
44 std::string TestBroadcast(); | 44 std::string TestBroadcast(); |
45 std::string TestSetOption(); | 45 std::string TestSetOption(); |
46 | 46 |
47 pp::NetAddress_Dev address_; | 47 pp::NetAddress address_; |
48 }; | 48 }; |
49 | 49 |
50 #endif // PPAPI_TESTS_TEST_UDP_SOCKET_H_ | 50 #endif // PPAPI_TESTS_TEST_UDP_SOCKET_H_ |
OLD | NEW |