vaapi_image_decoder_test_common.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. // Copyright 2019 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 MEDIA_GPU_VAAPI_VAAPI_IMAGE_DECODER_TEST_COMMON_H_
  5. #define MEDIA_GPU_VAAPI_VAAPI_IMAGE_DECODER_TEST_COMMON_H_
  6. #include <memory>
  7. #include <string>
  8. // This has to be included first.
  9. // See http://code.google.com/p/googletest/issues/detail?id=371
  10. #include "testing/gtest/include/gtest/gtest.h"
  11. #include "media/gpu/vaapi/test_utils.h"
  12. namespace base {
  13. class FilePath;
  14. }
  15. namespace media {
  16. class VaapiImageDecoder;
  17. class VaapiImageDecoderTestCommon
  18. : public testing::TestWithParam<vaapi_test_utils::TestParam> {
  19. public:
  20. VaapiImageDecoderTestCommon(std::unique_ptr<VaapiImageDecoder> decoder);
  21. ~VaapiImageDecoderTestCommon();
  22. void SetUp() override;
  23. VaapiImageDecoder* Decoder() const { return decoder_.get(); }
  24. // Find the location of the specified test file. If a file with specified path
  25. // is not found, treat the file as being relative to the test file directory.
  26. // This is either a custom test data path provided by --test_data_path, or the
  27. // default test data path (//media/test/data).
  28. base::FilePath FindTestDataFilePath(const std::string& file_name) const;
  29. private:
  30. std::string test_data_path_;
  31. std::unique_ptr<VaapiImageDecoder> decoder_;
  32. };
  33. } // namespace media
  34. #endif // MEDIA_GPU_VAAPI_VAAPI_IMAGE_DECODER_TEST_COMMON_H_