test_net_address_private_untrusted.h 1.4 KB

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