Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

[Engine] allow --enable-asserts flag to be passed to dart vm in profile mode. #52029

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions shell/common/switches.cc
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ static const std::string kAllowedDartFlags[] = {
"--null_assertions",
"--strict_null_safety_checks",
"--max_subtype_cache_entries",
"--enable-asserts",
};
// clang-format on

Expand Down
10 changes: 10 additions & 0 deletions shell/common/switches_unittests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down