MCPcopy Create free account
hub / github.com/Snapchat/Valdi / SetUp

Method SetUp

snap_drawing/test/src/LottieLayer_tests.cpp:32–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30class AnimatedImageLayerTests : public ::testing::Test {
31protected:
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;

Callers

nothing calls this directly

Calls 12

getTestDataFunction · 0.85
setContentLayerMethod · 0.80
descriptionMethod · 0.80
setListenerMethod · 0.65
valueMethod · 0.65
SizeClass · 0.50
setSizeMethod · 0.45
successMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45
millisecondsMethod · 0.45
getDurationMethod · 0.45

Tested by

no test coverage detected