UnityVideoDecoderFactoryTest.cpp 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #include "pch.h"
  2. #include "GraphicsDevice/IGraphicsDevice.h"
  3. #include "GraphicsDeviceContainer.h"
  4. #include "UnityVideoDecoderFactory.h"
  5. namespace unity
  6. {
  7. namespace webrtc
  8. {
  9. class UnityVideoDecoderFactoryTest : public testing::TestWithParam<UnityGfxRenderer>
  10. {
  11. public:
  12. UnityVideoDecoderFactoryTest()
  13. : container_(CreateGraphicsDeviceContainer(GetParam()))
  14. , device_(container_->device())
  15. {
  16. }
  17. protected:
  18. void SetUp() override
  19. {
  20. if (!device_)
  21. GTEST_SKIP() << "The graphics driver is not installed on the device.";
  22. }
  23. std::unique_ptr<GraphicsDeviceContainer> container_;
  24. IGraphicsDevice* device_;
  25. };
  26. TEST_P(UnityVideoDecoderFactoryTest, GetSupportedFormats)
  27. {
  28. auto factory = std::make_unique<UnityVideoDecoderFactory>(container_->device(), nullptr);
  29. EXPECT_NE(factory, nullptr);
  30. auto formats = factory->GetSupportedFormats();
  31. EXPECT_GT(formats.size(), 0);
  32. }
  33. INSTANTIATE_TEST_SUITE_P(GfxDevice, UnityVideoDecoderFactoryTest, testing::ValuesIn(supportedGfxDevices));
  34. } // namespace webrtc
  35. } // namespace unity