5#include "flutter/common/task_runners.h"
6#include "flutter/fml/paths.h"
7#include "flutter/fml/synchronization/count_down_latch.h"
8#include "flutter/fml/synchronization/waitable_event.h"
9#include "flutter/runtime/dart_vm.h"
10#include "flutter/runtime/dart_vm_lifecycle.h"
11#include "flutter/runtime/isolate_configuration.h"
12#include "flutter/testing/fixture_test.h"
20 auto settings = CreateSettingsForFixture();
32 auto settings = CreateSettingsForFixture();
37 for (
size_t i = 0;
i < 10;
i++) {
50 std::string entrypoint) {
52 TaskRunners runners(
"io.flutter.test", task_runner, task_runner, task_runner,
55 auto isolate_configuration =
73 std::move(isolate_configuration),
89 auto settings = CreateSettingsForFixture();
96 for (
size_t i = 0;
i < 3;
i++) {
106 const size_t isolate_count = 5;
109 auto vm_data = vm_ref.GetVMData();
110 for (
size_t i = 0;
i < isolate_count; ++
i) {
111 thread_task_runner->PostTask(
112 [vm_data, &
settings, &latch, thread_task_runner]() {
115 "testIsolateShutdown"));
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...
Provides thread-safe access to data that is necessary to bootstrap a new Dart VM instance....
fml::RefPtr< const DartSnapshot > GetIsolateSnapshot() const
Get the isolate snapshot necessary to launch isolates in the Dart VM. The Dart VM instance in which t...
const Settings & GetSettings() const
The settings object from which the Dart snapshots were inferred.
static DartVMRef Create(const Settings &settings, fml::RefPtr< const DartSnapshot > vm_snapshot=nullptr, fml::RefPtr< const DartSnapshot > isolate_snapshot=nullptr)
static bool IsInstanceRunning()
static size_t GetVMLaunchCount()
The number of times the VM has been launched in the process. This call is inherently racy because the...
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...
#define FML_LOG(severity)
#define FML_CHECK(condition)
fml::RefPtr< fml::TaskRunner > CreateNewThread(const std::string &name)
TEST_F(DisplayListTest, Defaults)
static std::shared_ptr< DartIsolate > CreateAndRunRootIsolate(const Settings &settings, const DartVMData &vm, const fml::RefPtr< fml::TaskRunner > &task_runner, std::string entrypoint)
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