)", num_nest_levels - 1).c_str(),
StringUtilities::RepeatString(R"(
)", num_nest_levels - 1).c_str());
FormattingContextDebugTracker format_independent_tracker;
ElementDocument* document = context->LoadDocumentFromMemory(document_rml);
document->Show();
TestsShell::RenderLoop();
int num_flex_formats = 0;
for (const auto& entry : format_independent_tracker.GetEntries())
{
if (entry.context_type == FormattingContextType::Flex && !entry.from_cache)
num_flex_formats += 1;
}
CHECK(num_flex_formats == expected_num_nest_levels_versus_num_flex_formats.at(num_nest_levels));
document->Close();
}
TestsShell::ShutdownShell();
}
TEST_CASE("LayoutIsolation.FlexFormat.shrink-to-fit.cache")
{
Context* context = TestsShell::GetContext();
REQUIRE(context);
constexpr int num_nest_levels = 2;
const Rml::String document_rml = Rml::CreateString(rml_flexbox_shrink_to_fit_nested.c_str(),
StringUtilities::RepeatString(R"(