Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 3e9ffe1

Browse files
authored
Whitelist the —enable_mirrors flag to fix regression in existing embedder. (#9266)
1 parent 7cde42c commit 3e9ffe1

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

shell/common/shell_unittests.cc

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include "flutter/fml/message_loop.h"
1616
#include "flutter/fml/synchronization/count_down_latch.h"
1717
#include "flutter/fml/synchronization/waitable_event.h"
18+
#include "flutter/runtime/dart_vm.h"
1819
#include "flutter/shell/common/platform_view.h"
1920
#include "flutter/shell/common/rasterizer.h"
2021
#include "flutter/shell/common/shell_test.h"
@@ -198,6 +199,21 @@ TEST_F(ShellTest, SecondaryIsolateBindingsAreSetupViaShellSettings) {
198199
ASSERT_FALSE(DartVMRef::IsInstanceRunning());
199200
}
200201

202+
TEST(ShellTestNoFixture, EnableMirrorsIsWhitelisted) {
203+
if (DartVM::IsRunningPrecompiledCode()) {
204+
// This covers profile and release modes which use AOT (where this flag does
205+
// not make sense anyway).
206+
GTEST_SKIP();
207+
return;
208+
}
209+
210+
const std::vector<fml::CommandLine::Option> options = {
211+
fml::CommandLine::Option("dart-flags", "--enable_mirrors")};
212+
fml::CommandLine command_line("", options, std::vector<std::string>());
213+
flutter::Settings settings = flutter::SettingsFromCommandLine(command_line);
214+
EXPECT_EQ(settings.dart_flags.size(), 1u);
215+
}
216+
201217
TEST_F(ShellTest, BlacklistedDartVMFlag) {
202218
// Run this test in a thread-safe manner, otherwise gtest will complain.
203219
::testing::FLAGS_gtest_death_test_style = "threadsafe";

shell/common/switches.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ static const std::string gDartFlagsWhitelist[] = {
4646
"--max_profile_depth",
4747
"--profile_period",
4848
"--random_seed",
49+
"--enable_mirrors",
4950
};
5051
// clang-format on
5152

0 commit comments

Comments
 (0)