未验证 提交 99240b7a 编写于 作者: B Ben Konyi 提交者: GitHub

Remove unnecessary whitelisted flags for --dart-flags (#9233)

上级 8eaddd60
......@@ -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
......
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册