[Engine] allow --enable-asserts flag to be passed to dart vm in profile mode. (flutter/engine#52029)

Allows https://github.com/flutter/flutter/issues/145729
This commit is contained in:
Jonah Williams 2024-04-10 14:53:52 -07:00 committed by GitHub
parent 3cd96ea83c
commit 1c2ffb9b30
2 changed files with 11 additions and 0 deletions

View File

@ -65,6 +65,7 @@ static const std::string kAllowedDartFlags[] = {
"--null_assertions",
"--strict_null_safety_checks",
"--max_subtype_cache_entries",
"--enable-asserts",
};
// clang-format on

View File

@ -123,6 +123,16 @@ TEST(SwitchesTest, NoEnableImpeller) {
}
}
#if !FLUTTER_RELEASE
TEST(SwitchesTest, EnableAsserts) {
fml::CommandLine command_line = fml::CommandLineFromInitializerList(
{"command", "--dart-flags=--enable-asserts"});
Settings settings = SettingsFromCommandLine(command_line);
ASSERT_EQ(settings.dart_flags.size(), 1ul);
EXPECT_EQ(settings.dart_flags[0], "--enable-asserts");
}
#endif
} // namespace testing
} // namespace flutter