test_image_data.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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_IMAGE_DATA_H_
  5. #define PPAPI_TESTS_TEST_IMAGE_DATA_H_
  6. #include <string>
  7. #include "ppapi/c/ppb_image_data.h"
  8. #include "ppapi/tests/test_case.h"
  9. class TestImageData : public TestCase {
  10. public:
  11. TestImageData(TestingInstance* instance) : TestCase(instance) {}
  12. // TestCase implementation.
  13. virtual bool Init();
  14. virtual void RunTests(const std::string& filter);
  15. private:
  16. std::string TestInvalidFormat();
  17. std::string TestGetNativeFormat();
  18. std::string TestFormatSupported();
  19. std::string TestInvalidSize();
  20. std::string TestHugeSize();
  21. std::string TestInitToZero();
  22. std::string TestIsImageData();
  23. // Subtests used by tests above; pass in a pixel format.
  24. std::string SubTestFormatSupported(PP_ImageDataFormat format);
  25. std::string SubTestInvalidSize(PP_ImageDataFormat format);
  26. std::string SubTestHugeSize(PP_ImageDataFormat format);
  27. std::string SubTestInitToZero(PP_ImageDataFormat format);
  28. std::string SubTestIsImageData(PP_ImageDataFormat format);
  29. // Used by the tests that access the C API directly.
  30. const PPB_ImageData* image_data_interface_;
  31. };
  32. #endif // PPAPI_TESTS_TEST_IMAGE_DATA_H_