18 bool did_pass =
false;
19 auto message_latch = std::make_shared<fml::AutoResetWaitableEvent>();
21 GetCurrentTaskRunner(),
27 auto nativeCallPlatformMessageResponseDart =
30 auto dart_state = std::make_shared<tonic::DartState>();
31 auto response = fml::MakeRefCounted<PlatformMessageResponseDart>(
34 ui_task_runner,
"foobar");
35 uint8_t*
data =
static_cast<uint8_t*
>(malloc(100));
36 auto mapping = std::make_unique<fml::MallocMapping>(
data, 100);
37 response->Complete(std::move(mapping));
40 AddNativeCallback(
"CallPlatformMessageResponseDart",
43 auto nativeFinishCallResponse = [message_latch,
47 message_latch->Signal();
50 AddNativeCallback(
"FinishCallResponse",
53 Settings settings = CreateSettingsForFixture();
55 std::unique_ptr<Shell> shell = CreateShell(settings, task_runners);
57 ASSERT_TRUE(shell->IsSetup());
59 configuration.SetEntrypoint(
"platformMessageResponseTest");
61 shell->RunEngine(std::move(configuration), [](
auto result) {
65 message_latch->Wait();
67 ASSERT_TRUE(did_pass);
68 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...