|
15 | 15 | #include "flutter/fml/message_loop.h" |
16 | 16 | #include "flutter/fml/synchronization/count_down_latch.h" |
17 | 17 | #include "flutter/fml/synchronization/waitable_event.h" |
| 18 | +#include "flutter/runtime/dart_vm.h" |
18 | 19 | #include "flutter/shell/common/platform_view.h" |
19 | 20 | #include "flutter/shell/common/rasterizer.h" |
20 | 21 | #include "flutter/shell/common/shell_test.h" |
@@ -198,6 +199,21 @@ TEST_F(ShellTest, SecondaryIsolateBindingsAreSetupViaShellSettings) { |
198 | 199 | ASSERT_FALSE(DartVMRef::IsInstanceRunning()); |
199 | 200 | } |
200 | 201 |
|
| 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 | + |
201 | 217 | TEST_F(ShellTest, BlacklistedDartVMFlag) { |
202 | 218 | // Run this test in a thread-safe manner, otherwise gtest will complain. |
203 | 219 | ::testing::FLAGS_gtest_death_test_style = "threadsafe"; |
|
0 commit comments