Remove unnecessary whitelisted flags for --dart-flags (flutter/engine#9233)

This commit is contained in:
Ben Konyi
2019-06-07 14:43:43 -07:00
committed by GitHub
parent edabb87b03
commit 00de8257d5
2 changed files with 7 additions and 5 deletions

View File

@@ -221,7 +221,7 @@ TEST_F(ShellTest, BlacklistedDartVMFlag) {
TEST_F(ShellTest, WhitelistedDartVMFlag) {
const std::vector<fml::CommandLine::Option> options = {
fml::CommandLine::Option("dart-flags",
"--max_profile_depth 1,--trace_service")};
"--max_profile_depth 1,--random_seed 42")};
fml::CommandLine command_line("", options, std::vector<std::string>());
flutter::Settings settings = flutter::SettingsFromCommandLine(command_line);
@@ -229,7 +229,7 @@ TEST_F(ShellTest, WhitelistedDartVMFlag) {
FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_DYNAMIC_RELEASE
EXPECT_EQ(settings.dart_flags.size(), 2u);
EXPECT_EQ(settings.dart_flags[0], "--max_profile_depth 1");
EXPECT_EQ(settings.dart_flags[1], "--trace_service");
EXPECT_EQ(settings.dart_flags[1], "--random_seed 42");
#else
EXPECT_EQ(settings.dart_flags.size(), 0u);
#endif

View File

@@ -41,11 +41,13 @@ struct SwitchDesc {
FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_DYNAMIC_RELEASE
// List of common and safe VM flags to allow to be passed directly to the VM.
// clang-format off
static const std::string gDartFlagsWhitelist[] = {
"--max_profile_depth", "--profile_period", "--random_seed",
"--trace_profiler", "--trace_profiler_verbose", "--trace_service",
"--trace_service_verbose",
"--max_profile_depth",
"--profile_period",
"--random_seed",
};
// clang-format on
#endif