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

Function assertVisibleInRange

valdi/test/runtime/ViewNode_tests.cpp:2597–2609  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2595 for (size_t i = 0; i < kMaxChildrenBeforeIndexing + 1; i++) {
2596 auto newChild = utils.createView();
2597 utils.setViewNodeFrame(newChild, 0, static_cast<double>(i) * 20, 0, 0);
2598 root->appendChild(utils.getViewTransactionScope(), newChild);
2599
2600 children.emplace_back(std::move(newChild));
2601 }
2602
2603 root->performLayout(utils.getViewTransactionScope(), Size(100, 100), LayoutDirectionLTR);
2604 root->updateVisibilityAndPerformUpdates(utils.getViewTransactionScope());
2605
2606 ASSERT_TRUE(root->getChildrenIndexer() != nullptr);
2607 ASSERT_FALSE(root->getChildrenIndexer()->needsUpdate());
2608
2609 assertAllFlagsAreUpToDate(root.get());
2610
2611 ASSERT_FALSE(children[5]->isVisibleInViewport());
2612 ASSERT_FALSE(children[5]->hasView());

Callers 1

TESTFunction · 0.85

Calls 2

isVisibleInViewportMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected