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

Function TEST_F

third-party/yoga/test/StyleCarouselLayout_test.cpp:200–223  ·  view source on GitHub ↗

Style items with height:100% should fill the scroll view's 60px cross-axis

Source from the content-addressed store, hash-verified

198
199// Style items with height:100% should fill the scroll view's 60px cross-axis
200TEST_F(StyleCarouselLayoutTest, styleItemsFillCarouselHeight) {
201 auto l = buildCarousel();
202
203 YGNodeCalculateLayout(l.root, kScreenWidth, kScreenHeight, YGDirectionLTR);
204 dumpLayout(l);
205
206 float carouselLayoutHeight = YGNodeLayoutGetHeight(l.carouselLayout);
207 ASSERT_FLOAT_EQ(kCarouselHeight, carouselLayoutHeight)
208 << "Carousel layout should be 60px";
209
210 float scrollViewHeight = YGNodeLayoutGetHeight(l.scrollView);
211 ASSERT_GT(scrollViewHeight, 0) << "ScrollView should have non-zero height";
212 EXPECT_FLOAT_EQ(kCarouselHeight, scrollViewHeight)
213 << "ScrollView should fill the 60px carousel height";
214
215 for (int i = 0; i < kStyleItemCount; i++) {
216 float itemHeight = YGNodeLayoutGetHeight(l.styleItems[i]);
217 EXPECT_FLOAT_EQ(scrollViewHeight, itemHeight)
218 << "Style item " << i << " with height:100% should equal scroll view height ("
219 << scrollViewHeight << "), got " << itemHeight;
220 }
221
222 YGNodeFreeRecursive(l.root);
223}
224
225// The inner container (height:55%) should be vertically centered in the 60px bar
226TEST_F(StyleCarouselLayoutTest, innerContainerVerticallyCentered) {

Callers

nothing calls this directly

Calls 15

YGNodeCalculateLayoutFunction · 0.85
YGNodeLayoutGetHeightFunction · 0.85
YGNodeFreeRecursiveFunction · 0.85
YGNodeLayoutGetTopFunction · 0.85
YGNodeStyleSetWidthFunction · 0.85
YGNodeStyleSetHeightFunction · 0.85
YGNodeStyleSetOverflowFunction · 0.85
YGNodeStyleSetAlignItemsFunction · 0.85
YGNodeStyleSetFlexGrowFunction · 0.85
YGNodeInsertChildFunction · 0.85

Tested by

no test coverage detected