7
7
#include " flutter/runtime/dart_vm.h"
8
8
#include " flutter/shell/common/shell.h"
9
9
#include " flutter/shell/common/thread_host.h"
10
+ #include " flutter/testing/elf_loader.h"
10
11
#include " flutter/testing/testing.h"
11
12
12
13
namespace flutter {
@@ -18,32 +19,19 @@ static void StartupAndShutdownShell(benchmark::State& state,
18
19
fml::FilePermission::kRead );
19
20
std::unique_ptr<Shell> shell;
20
21
std::unique_ptr<ThreadHost> thread_host;
22
+ testing::ELFAOTSymbols aot_symbols;
23
+
21
24
{
22
25
benchmarking::ScopedPauseTiming pause (state, !measure_startup);
23
26
Settings settings = {};
24
27
settings.task_observer_add = [](intptr_t , fml::closure) {};
25
28
settings.task_observer_remove = [](intptr_t ) {};
26
29
27
30
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." ;
47
35
} else {
48
36
settings.application_kernels = [&]() {
49
37
std::vector<std::unique_ptr<const fml::Mapping>> kernel_mappings;
0 commit comments