UnityVideoEncoderFactoryTest.cpp 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #include "pch.h"
  2. #include "GraphicsDevice/IGraphicsDevice.h"
  3. #include "GraphicsDeviceContainer.h"
  4. #include "UnityVideoEncoderFactory.h"
  5. namespace unity
  6. {
  7. namespace webrtc
  8. {
  9. class UnityVideoEncoderFactoryTest : public testing::TestWithParam<UnityGfxRenderer>
  10. {
  11. public:
  12. UnityVideoEncoderFactoryTest()
  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(UnityVideoEncoderFactoryTest, GetSupportedFormats)
  27. {
  28. auto factory = std::make_unique<UnityVideoEncoderFactory>(container_->device(), nullptr);
  29. auto formats = factory->GetSupportedFormats();
  30. EXPECT_GT(formats.size(), 0);
  31. }
  32. INSTANTIATE_TEST_SUITE_P(GfxDevice, UnityVideoEncoderFactoryTest, testing::ValuesIn(supportedGfxDevices));
  33. } // namespace webrtc
  34. } // namespace unity