Skip to content

Commit

Permalink
Whitelist the —enable_mirrors flag to fix regression in existing embe…
Browse files Browse the repository at this point in the history
…dder. (flutter#9266)
  • Loading branch information
chinmaygarde committed Jun 11, 2019
1 parent 7cde42c commit 3e9ffe1
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
16 changes: 16 additions & 0 deletions shell/common/shell_unittests.cc
Expand Up @@ -15,6 +15,7 @@
#include "flutter/fml/message_loop.h"
#include "flutter/fml/synchronization/count_down_latch.h"
#include "flutter/fml/synchronization/waitable_event.h"
#include "flutter/runtime/dart_vm.h"
#include "flutter/shell/common/platform_view.h"
#include "flutter/shell/common/rasterizer.h"
#include "flutter/shell/common/shell_test.h"
Expand Down Expand Up @@ -198,6 +199,21 @@ TEST_F(ShellTest, SecondaryIsolateBindingsAreSetupViaShellSettings) {
ASSERT_FALSE(DartVMRef::IsInstanceRunning());
}

TEST(ShellTestNoFixture, EnableMirrorsIsWhitelisted) {
if (DartVM::IsRunningPrecompiledCode()) {
// This covers profile and release modes which use AOT (where this flag does
// not make sense anyway).
GTEST_SKIP();
return;
}

const std::vector<fml::CommandLine::Option> options = {
fml::CommandLine::Option("dart-flags", "--enable_mirrors")};
fml::CommandLine command_line("", options, std::vector<std::string>());
flutter::Settings settings = flutter::SettingsFromCommandLine(command_line);
EXPECT_EQ(settings.dart_flags.size(), 1u);
}

TEST_F(ShellTest, BlacklistedDartVMFlag) {
// Run this test in a thread-safe manner, otherwise gtest will complain.
::testing::FLAGS_gtest_death_test_style = "threadsafe";
Expand Down
1 change: 1 addition & 0 deletions shell/common/switches.cc
Expand Up @@ -46,6 +46,7 @@ static const std::string gDartFlagsWhitelist[] = {
"--max_profile_depth",
"--profile_period",
"--random_seed",
"--enable_mirrors",
};
// clang-format on

Expand Down

0 comments on commit 3e9ffe1

Please sign in to comment.