| 30 | class AnimatedImageLayerTests : public ::testing::Test { |
| 31 | protected: |
| 32 | void SetUp() override { |
| 33 | auto fontManager = makeShared<FontManager>(ConsoleLogger::getLogger()); |
| 34 | auto resources = makeShared<Resources>(fontManager, 1.0f, ConsoleLogger::getLogger()); |
| 35 | |
| 36 | _layerRoot = makeLayer<LayerRoot>(resources); |
| 37 | _animatedImageLayer = makeLayer<AnimatedImageLayer>(resources); |
| 38 | _layerRoot->setContentLayer(_animatedImageLayer, ContentLayerSizingModeMatchSize); |
| 39 | _layerRoot->setSize(Size(1.0f, 1.0f), 1.0f); |
| 40 | _layerRoot->setListener(&_layerRootListener); |
| 41 | |
| 42 | auto testData = getTestData("lottie_loading.json"); |
| 43 | SC_ASSERT(testData.success(), testData.description()); |
| 44 | |
| 45 | auto animatedImage = AnimatedImage::make(fontManager, testData.value().data(), testData.value().size()); |
| 46 | SC_ASSERT(animatedImage.success(), animatedImage.description()); |
| 47 | _animatedImage = animatedImage.moveValue(); |
| 48 | |
| 49 | ASSERT_EQ(kExpectedAnimationDurationMs, static_cast<int>(_animatedImage->getDuration().milliseconds())); |
| 50 | } |
| 51 | |
| 52 | void TearDown() override { |
| 53 | _animatedImageLayer = nullptr; |
nothing calls this directly
no test coverage detected