39 {
43 ASSERT_TRUE(vm_ref);
44 auto vm_data = vm_ref.GetVMData();
45 ASSERT_TRUE(vm_data);
46
52 );
53
54 auto isolate_configuration =
56
57 UIDartState::Context context(task_runners);
58 context.advisory_script_uri = "main.dart";
59 context.advisory_script_entrypoint = "main";
61 vm_data->GetSettings(),
62 vm_data->GetIsolateSnapshot(),
63 nullptr,
65 nullptr,
68 "main",
69 std::nullopt,
70 {},
71 std::move(isolate_configuration),
72 context
73 );
74 root_isolate_ = weak_isolate.lock()->isolate();
75 ASSERT_TRUE(root_isolate_);
76
78
81 }
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 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...
virtual Settings CreateSettingsForFixture()
fml::RefPtr< fml::TaskRunner > GetCurrentTaskRunner()
Get the task runner for the thread that the current unit-test is running on. This creates a message l...
DART_EXPORT void Dart_ShutdownIsolate(void)
DART_EXPORT void Dart_EnterIsolate(Dart_Isolate isolate)
std::string GetCurrentTestName()
Gets the name of the currently running test. This is useful in generating logs or assets based on tes...