5#include "flutter/third_party/tonic/dart_state.h"
6#include "flutter/common/task_runners.h"
7#include "flutter/runtime/dart_vm_lifecycle.h"
8#include "flutter/runtime/isolate_configuration.h"
9#include "flutter/testing/fixture_test.h"
18 auto settings = CreateSettingsForFixture();
23 auto vm_data = vm_ref.GetVMData();
31 auto isolate_configuration =
36 isolate_configuration->IsNullSafetyEnabled(*isolate_snapshot);
40 "main.dart",
"main", vm_data->GetIsolateSnapshot()->GetDataMapping(),
41 vm_data->GetIsolateSnapshot()->GetInstructionsMapping(), &isolate_flags,
42 nullptr,
nullptr, &
error);
54 auto settings = CreateSettingsForFixture();
57 auto vm_data = vm_ref.GetVMData();
65 auto isolate_configuration =
72 vm_data->GetSettings(),
73 vm_data->GetIsolateSnapshot(),
82 std::move(isolate_configuration),
85 auto root_isolate = weak_isolate.lock();
86 ASSERT_TRUE(root_isolate);
91 ASSERT_TRUE(root_isolate->Shutdown());
static std::weak_ptr< DartIsolate > CreateRunningRootIsolate(const Settings &settings, const fml::RefPtr< const DartSnapshot > &isolate_snapshot, std::unique_ptr< PlatformConfiguration > platform_configuration, Flags flags, const fml::closure &root_isolate_create_callback, const fml::closure &isolate_create_callback, const fml::closure &isolate_shutdown_callback, std::optional< std::string > dart_entrypoint, std::optional< std::string > dart_entrypoint_library, const std::vector< std::string > &dart_entrypoint_args, std::unique_ptr< IsolateConfiguration > isolate_configuration, const UIDartState::Context &context, const DartIsolate *spawning_isolate=nullptr)
Creates an instance of a root isolate and returns a weak pointer to the same. The isolate instance ma...
static fml::RefPtr< const DartSnapshot > VMSnapshotFromSettings(const Settings &settings)
From the fields present in the given settings object, infer the core snapshot.
static fml::RefPtr< const DartSnapshot > IsolateSnapshotFromSettings(const Settings &settings)
From the fields present in the given settings object, infer the isolate snapshot.
static DartVMRef Create(const Settings &settings, fml::RefPtr< const DartSnapshot > vm_snapshot=nullptr, fml::RefPtr< const DartSnapshot > isolate_snapshot=nullptr)
static bool IsInstanceRunning()
static std::unique_ptr< IsolateConfiguration > InferFromSettings(const Settings &settings, const std::shared_ptr< AssetManager > &asset_manager=nullptr, const fml::RefPtr< fml::TaskRunner > &io_worker=nullptr, IsolateLaunchType launch_type=IsolateLaunchType::kNewGroup)
Attempts to infer the isolate configuration from the Settings object. If the VM is configured for AOT...
static DartState * Current()
DART_EXPORT Dart_Isolate Dart_CreateIsolateGroup(const char *script_uri, const char *name, const uint8_t *isolate_snapshot_data, const uint8_t *isolate_snapshot_instructions, Dart_IsolateFlags *flags, void *isolate_group_data, void *isolate_data, char **error)
DART_EXPORT void Dart_IsolateFlagsInitialize(Dart_IsolateFlags *flags)
DART_EXPORT void Dart_ShutdownIsolate(void)
DART_EXPORT Dart_Isolate Dart_CurrentIsolate(void)
const uint8_t uint32_t uint32_t GError ** error
fml::RefPtr< fml::TaskRunner > GetCurrentTaskRunner()
std::string GetCurrentTestName()
Gets the name of the currently running test. This is useful in generating logs or assets based on tes...
TEST_F(DisplayListTest, Defaults)
bool snapshot_is_dontneed_safe
The subset of state which is owned by the shell or engine and passed through the RuntimeController in...
std::string advisory_script_uri
std::string advisory_script_entrypoint