25 auto message_latch = std::make_shared<fml::AutoResetWaitableEvent>();
27 auto validate_codec = [](Dart_NativeArguments
args) {
28 auto handle = Dart_GetNativeArgument(
args, 0);
30 Dart_Handle result = Dart_GetNativeInstanceField(
32 ASSERT_FALSE(Dart_IsError(result));
34 auto finish = [message_latch](Dart_NativeArguments
args) {
35 message_latch->Signal();
38 Settings settings = CreateSettingsForFixture();
40 GetCurrentTaskRunner(),
49 std::unique_ptr<Shell> shell = CreateShell(settings, task_runners);
51 ASSERT_TRUE(shell->IsSetup());
53 configuration.SetEntrypoint(
"createSingleFrameCodec");
55 shell->RunEngine(std::move(configuration), [](
auto result) {
59 message_latch->Wait();
60 DestroyShell(std::move(shell), task_runners);
65 GTEST_SKIP() <<
"Only works on macOS currently.";
68 Settings settings = CreateSettingsForFixture();
71 GetCurrentTaskRunner(),
76 std::unique_ptr<Shell> shell = CreateShell(settings, task_runners);
77 ASSERT_TRUE(shell->IsSetup());
79 auto message_latch = std::make_shared<fml::AutoResetWaitableEvent>();
80 auto finish = [message_latch](Dart_NativeArguments
args) {
81 message_latch->Signal();
85 auto turn_off_gpu = [&](Dart_NativeArguments
args) {
86 auto handle = Dart_GetNativeArgument(
args, 0);
88 ASSERT_TRUE(Dart_IsBoolean(handle));
89 Dart_BooleanValue(handle, &
value);
90 TurnOffGPU(shell.get(),
value);
94 auto flush_awaiting_tasks = [&](Dart_NativeArguments
args) {
98 std::shared_ptr<impeller::Context> impeller_context =
99 io_manager->GetImpellerContext();
103 impeller_context->StoreTaskForGPU([] {}, [] {});
108 AddNativeCallback(
"FlushGpuAwaitingTasks",
112 configuration.SetEntrypoint(
"singleFrameCodecHandlesNoGpu");
114 shell->RunEngine(std::move(configuration), [](
auto result) {
118 message_latch->Wait();
119 DestroyShell(std::move(shell), task_runners);
static RunConfiguration InferFromSettings(const Settings &settings, const fml::RefPtr< fml::TaskRunner > &io_worker=nullptr, IsolateLaunchType launch_type=IsolateLaunchType::kNewGroup)
Attempts to infer a run configuration from the settings object. This tries to create a run configurat...
static constexpr int32_t kMaxTasksAwaitingGPU