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 PAPPI_TESTS_TEST_NET_ADDRESS_PRIVATE_UNTRUSTED_H_
      6 #define PAPPI_TESTS_TEST_NET_ADDRESS_PRIVATE_UNTRUSTED_H_
      7 
      8 #include <string>
      9 
     10 #include "ppapi/cpp/private/tcp_socket_private.h"
     11 #include "ppapi/tests/test_case.h"
     12 
     13 // TestNetAddressPrivate doesn't compile via NaCl toolchain, because
     14 // these tests depend on network API which is not available in
     15 // NaCl. TestNetAddressPrivateUntrusted is written only for check that
     16 // API is correctly exposed to NaCl, not for checking correctness of
     17 // API --- this is a job of TestNetAddressPrivate.
     18 class TestNetAddressPrivateUntrusted : public TestCase {
     19  public:
     20   explicit TestNetAddressPrivateUntrusted(TestingInstance* instance);
     21 
     22   // TestCase implementation.
     23   virtual bool Init();
     24   virtual void RunTests(const std::string& filter);
     25 
     26  private:
     27   int32_t Connect(pp::TCPSocketPrivate* socket,
     28                   const std::string& host,
     29                   uint16_t port);
     30 
     31   std::string TestAreEqual();
     32   std::string TestAreHostsEqual();
     33   std::string TestDescribe();
     34   std::string TestReplacePort();
     35   std::string TestGetAnyAddress();
     36   std::string TestGetFamily();
     37   std::string TestGetPort();
     38   std::string TestGetAddress();
     39 
     40   std::string host_;
     41   uint16_t port_;
     42 };
     43 
     44 #endif  // PAPPI_TESTS_TEST_NET_ADDRESS_PRIVATE_UNTRUSTED_H_
     45