Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / ppapi / tests / test_udp_socket_private.h
blobe4a23c976e40cadc9e8e77b860aa7acf2b13ccc6
1 // Copyright (c) 2012 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 PPAPI_TESTS_TEST_UDP_SOCKET_PRIVATE_H_
6 #define PPAPI_TESTS_TEST_UDP_SOCKET_PRIVATE_H_
8 #include <string>
10 #include "ppapi/c/pp_stdint.h"
11 #include "ppapi/cpp/private/udp_socket_private.h"
12 #include "ppapi/tests/test_case.h"
14 class TestUDPSocketPrivate : public TestCase {
15 public:
16 explicit TestUDPSocketPrivate(TestingInstance* instance);
18 // TestCase implementation.
19 virtual bool Init();
20 virtual void RunTests(const std::string& filter);
22 private:
23 std::string GetLocalAddress(PP_NetAddress_Private* address);
24 std::string SetBroadcastOptions(pp::UDPSocketPrivate* socket);
25 std::string BindUDPSocket(pp::UDPSocketPrivate* socket,
26 PP_NetAddress_Private *address);
27 std::string LookupPortAndBindUDPSocket(pp::UDPSocketPrivate* socket,
28 PP_NetAddress_Private* address);
29 std::string BindUDPSocketFailure(pp::UDPSocketPrivate* socket,
30 PP_NetAddress_Private *address);
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);
40 std::string TestConnect();
41 std::string TestConnectFailure();
42 std::string TestBroadcast();
43 std::string TestSetSocketFeatureErrors();
45 std::string host_;
46 uint16_t port_;
49 #endif // PPAPI_TESTS_TEST_UDP_SOCKET_PRIVATE_H_