diff --git a/shell/common/switches.cc b/shell/common/switches.cc index 40a4fd5565072..c19f14fd71305 100644 --- a/shell/common/switches.cc +++ b/shell/common/switches.cc @@ -65,6 +65,7 @@ static const std::string kAllowedDartFlags[] = { "--null_assertions", "--strict_null_safety_checks", "--max_subtype_cache_entries", + "--enable-asserts", }; // clang-format on diff --git a/shell/common/switches_unittests.cc b/shell/common/switches_unittests.cc index 617c0a891cfa7..b4494a2968170 100644 --- a/shell/common/switches_unittests.cc +++ b/shell/common/switches_unittests.cc @@ -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