Home | History | Annotate | Download | only in tests
      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.
      4 
      5 #ifndef PPAPI_TESTS_TEST_UDP_SOCKET_PRIVATE_H_
      6 #define PPAPI_TESTS_TEST_UDP_SOCKET_PRIVATE_H_
      7 
      8 #include <string>
      9 
     10 #include "ppapi/c/pp_stdint.h"
     11 #include "ppapi/cpp/private/udp_socket_private.h"
     12 #include "ppapi/tests/test_case.h"
     13 
     14 class TestUDPSocketPrivate : public TestCase {
     15  public:
     16   explicit TestUDPSocketPrivate(TestingInstance* instance);
     17 
     18   // TestCase implementation.
     19   virtual bool Init();
     20   virtual void RunTests(const std::string& filter);
     21 
     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);
     39 
     40   std::string TestConnect();
     41   std::string TestConnectFailure();
     42   std::string TestBroadcast();
     43   std::string TestSetSocketFeatureErrors();
     44 
     45   std::string host_;
     46   uint16_t port_;
     47 };
     48 
     49 #endif  // PPAPI_TESTS_TEST_UDP_SOCKET_PRIVATE_H_
     50