Skip to content

Commit

Permalink
Remove unnecessary whitelisted flags for --dart-flags (#9233)
Browse files Browse the repository at this point in the history
  • Loading branch information
bkonyi committed Jun 7, 2019
1 parent 8eaddd6 commit 99240b7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions shell/common/shell_unittests.cc
Expand Up @@ -221,15 +221,15 @@ 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);

#if FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_RELEASE && \
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
Expand Down
8 changes: 5 additions & 3 deletions shell/common/switches.cc
Expand Up @@ -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

Expand Down

0 comments on commit 99240b7

Please sign in to comment.