diff --git a/lib/ui/BUILD.gn b/lib/ui/BUILD.gn index 235c1acdefdf9..4d3210d3bef37 100644 --- a/lib/ui/BUILD.gn +++ b/lib/ui/BUILD.gn @@ -175,10 +175,7 @@ if (current_toolchain == host_toolchain) { ":ui", ":ui_unittests_fixtures", "//flutter/common", - "//flutter/fml", - "//flutter/lib/snapshot", - "//flutter/runtime", - "//flutter/shell/common", + "//flutter/testing", "//flutter/testing:dart", "//flutter/testing:opengl", "//flutter/third_party/tonic", diff --git a/runtime/BUILD.gn b/runtime/BUILD.gn index a61d36256698b..59ebfbedc9d92 100644 --- a/runtime/BUILD.gn +++ b/runtime/BUILD.gn @@ -150,6 +150,7 @@ source_set("runtime_unittests_common") { "//flutter/fml", "//flutter/lib/snapshot", "//flutter/shell/common", + "//flutter/testing", "//flutter/testing:dart", "//flutter/third_party/tonic", "//third_party/dart/runtime/bin:elf_loader", diff --git a/shell/common/BUILD.gn b/shell/common/BUILD.gn index 970638ea8dac6..8e4a48e2bb000 100644 --- a/shell/common/BUILD.gn +++ b/shell/common/BUILD.gn @@ -209,6 +209,7 @@ if (enable_unittests) { "//flutter/fml/dart", "//flutter/lib/ui:ui", "//flutter/shell", + "//flutter/testing", "//flutter/testing:dart", ] @@ -278,6 +279,7 @@ if (enable_unittests) { deps = [ ":shell_unittests_fixtures", "//flutter/benchmarking", + "//flutter/testing:dart", "//flutter/testing:testing_lib", ] } diff --git a/shell/common/shell_benchmarks.cc b/shell/common/shell_benchmarks.cc index f7eb44e4c551a..99d38e70d8143 100644 --- a/shell/common/shell_benchmarks.cc +++ b/shell/common/shell_benchmarks.cc @@ -7,6 +7,7 @@ #include "flutter/runtime/dart_vm.h" #include "flutter/shell/common/shell.h" #include "flutter/shell/common/thread_host.h" +#include "flutter/testing/elf_loader.h" #include "flutter/testing/testing.h" namespace flutter { @@ -18,6 +19,8 @@ static void StartupAndShutdownShell(benchmark::State& state, fml::FilePermission::kRead); std::unique_ptr shell; std::unique_ptr thread_host; + testing::ELFAOTSymbols aot_symbols; + { benchmarking::ScopedPauseTiming pause(state, !measure_startup); Settings settings = {}; @@ -25,25 +28,10 @@ static void StartupAndShutdownShell(benchmark::State& state, settings.task_observer_remove = [](intptr_t) {}; if (DartVM::IsRunningPrecompiledCode()) { - settings.vm_snapshot_data = [&]() { - return fml::FileMapping::CreateReadOnly(assets_dir, "vm_snapshot_data"); - }; - - settings.isolate_snapshot_data = [&]() { - return fml::FileMapping::CreateReadOnly(assets_dir, - "isolate_snapshot_data"); - }; - - settings.vm_snapshot_instr = [&]() { - return fml::FileMapping::CreateReadExecute(assets_dir, - "vm_snapshot_instr"); - }; - - settings.isolate_snapshot_instr = [&]() { - return fml::FileMapping::CreateReadExecute(assets_dir, - "isolate_snapshot_instr"); - }; - + aot_symbols = testing::LoadELFSymbolFromFixturesIfNeccessary(); + FML_CHECK( + testing::PrepareSettingsForAOTWithSymbols(settings, aot_symbols)) + << "Could not setup settings with AOT symbols."; } else { settings.application_kernels = [&]() { std::vector> kernel_mappings; diff --git a/shell/platform/embedder/BUILD.gn b/shell/platform/embedder/BUILD.gn index 7215622912c76..09547a3de27e0 100644 --- a/shell/platform/embedder/BUILD.gn +++ b/shell/platform/embedder/BUILD.gn @@ -137,6 +137,7 @@ if (current_toolchain == host_toolchain) { "//flutter/flow", "//flutter/lib/ui", "//flutter/runtime", + "//flutter/testing", "//flutter/testing:dart", "//flutter/testing:opengl", "//flutter/testing:skia", diff --git a/testing/BUILD.gn b/testing/BUILD.gn index 67a920f10128b..b8c3bd0a2d53b 100644 --- a/testing/BUILD.gn +++ b/testing/BUILD.gn @@ -52,7 +52,7 @@ source_set("dart") { ] public_deps = [ - ":testing", + ":testing_lib", "//flutter/common", "//flutter/runtime", "//flutter/runtime:libdart",