| 72 | }; |
| 73 | |
| 74 | TEST_F(AnimatedImageLayerTests, setsAnimationWhenSceneIsSetWithAdvanceRate) { |
| 75 | update(0.5); |
| 76 | |
| 77 | ASSERT_FALSE(_animatedImageLayer->needsProcessAnimations()); |
| 78 | |
| 79 | _animatedImageLayer->setImage(_animatedImage); |
| 80 | |
| 81 | ASSERT_EQ(static_cast<size_t>(0), _animatedImageLayer->getAnimationKeys().size()); |
| 82 | ASSERT_FALSE(_animatedImageLayer->needsProcessAnimations()); |
| 83 | |
| 84 | _animatedImageLayer->setAdvanceRate(1.0); |
| 85 | |
| 86 | ASSERT_EQ(static_cast<size_t>(1), _animatedImageLayer->getAnimationKeys().size()); |
| 87 | ASSERT_TRUE(_animatedImageLayer->needsProcessAnimations()); |
| 88 | |
| 89 | ASSERT_TRUE(update(0.5)); |
| 90 | |
| 91 | ASSERT_EQ(static_cast<size_t>(1), _animatedImageLayer->getAnimationKeys().size()); |
| 92 | ASSERT_TRUE(_animatedImageLayer->needsProcessAnimations()); |
| 93 | |
| 94 | _animatedImageLayer->setImage(nullptr); |
| 95 | |
| 96 | ASSERT_EQ(static_cast<size_t>(0), _animatedImageLayer->getAnimationKeys().size()); |
| 97 | ASSERT_TRUE(_animatedImageLayer->needsProcessAnimations()); |
| 98 | |
| 99 | ASSERT_TRUE(update(0.5)); |
| 100 | |
| 101 | ASSERT_EQ(static_cast<size_t>(0), _animatedImageLayer->getAnimationKeys().size()); |
| 102 | ASSERT_FALSE(_animatedImageLayer->needsProcessAnimations()); |
| 103 | |
| 104 | _animatedImageLayer->setImage(_animatedImage); |
| 105 | |
| 106 | ASSERT_EQ(static_cast<size_t>(1), _animatedImageLayer->getAnimationKeys().size()); |
| 107 | ASSERT_TRUE(_animatedImageLayer->needsProcessAnimations()); |
| 108 | } |
| 109 | |
| 110 | TEST_F(AnimatedImageLayerTests, canSeek) { |
| 111 | _animatedImageLayer->setImage(_animatedImage); |
nothing calls this directly
no test coverage detected