test_var_deprecated.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_VAR_DEPRECATED_H_
  5. #define PPAPI_TESTS_TEST_VAR_DEPRECATED_H_
  6. #include <string>
  7. #include "ppapi/c/dev/ppb_var_deprecated.h"
  8. #include "ppapi/cpp/private/var_private.h"
  9. #include "ppapi/tests/test_case.h"
  10. class TestVarDeprecated : public TestCase {
  11. public:
  12. explicit TestVarDeprecated(TestingInstance* instance) : TestCase(instance) {}
  13. // TestCase implementation.
  14. virtual bool Init();
  15. virtual void RunTests(const std::string& filter);
  16. void set_var_from_page(const pp::VarPrivate& v) { var_from_page_ = v; }
  17. protected:
  18. // Test case protected overrides.
  19. virtual pp::deprecated::ScriptableObject* CreateTestObject();
  20. private:
  21. std::string TestBasicString();
  22. std::string TestInvalidAndEmpty();
  23. std::string TestInvalidUtf8();
  24. std::string TestNullInputInUtf8Conversion();
  25. std::string TestValidUtf8();
  26. std::string TestUtf8WithEmbeddedNulls();
  27. std::string TestVarToUtf8ForWrongType();
  28. std::string TestHasPropertyAndMethod();
  29. std::string TestPassReference();
  30. // Used by the tests that access the C API directly.
  31. const PPB_Var_Deprecated* var_interface_;
  32. // Saves the var from when a value is set on the test from the page.
  33. pp::VarPrivate var_from_page_;
  34. };
  35. #endif // PPAPI_TESTS_TEST_VAR_DEPRECATED_H_