77#include " flutter/runtime/dart_vm.h"
88#include " flutter/shell/common/shell.h"
99#include " flutter/shell/common/thread_host.h"
10+ #include " flutter/testing/elf_loader.h"
1011#include " flutter/testing/testing.h"
1112
1213namespace flutter {
@@ -18,32 +19,19 @@ static void StartupAndShutdownShell(benchmark::State& state,
1819 fml::FilePermission::kRead );
1920 std::unique_ptr<Shell> shell;
2021 std::unique_ptr<ThreadHost> thread_host;
22+ testing::ELFAOTSymbols aot_symbols;
23+
2124 {
2225 benchmarking::ScopedPauseTiming pause (state, !measure_startup);
2326 Settings settings = {};
2427 settings.task_observer_add = [](intptr_t , fml::closure) {};
2528 settings.task_observer_remove = [](intptr_t ) {};
2629
2730 if (DartVM::IsRunningPrecompiledCode ()) {
28- settings.vm_snapshot_data = [&]() {
29- return fml::FileMapping::CreateReadOnly (assets_dir, " vm_snapshot_data" );
30- };
31-
32- settings.isolate_snapshot_data = [&]() {
33- return fml::FileMapping::CreateReadOnly (assets_dir,
34- " isolate_snapshot_data" );
35- };
36-
37- settings.vm_snapshot_instr = [&]() {
38- return fml::FileMapping::CreateReadExecute (assets_dir,
39- " vm_snapshot_instr" );
40- };
41-
42- settings.isolate_snapshot_instr = [&]() {
43- return fml::FileMapping::CreateReadExecute (assets_dir,
44- " isolate_snapshot_instr" );
45- };
46-
31+ aot_symbols = testing::LoadELFSymbolFromFixturesIfNeccessary ();
32+ FML_CHECK (
33+ testing::PrepareSettingsForAOTWithSymbols (settings, aot_symbols))
34+ << " Could not setup settings with AOT symbols." ;
4735 } else {
4836 settings.application_kernels = [&]() {
4937 std::vector<std::unique_ptr<const fml::Mapping>> kernel_mappings;
0 commit comments