16 auto message_latch = std::make_shared<fml::AutoResetWaitableEvent>();
18 auto nativeSemanticsUpdate = [message_latch](Dart_NativeArguments
args) {
19 auto handle = Dart_GetNativeArgument(
args, 0);
21 Dart_Handle result = Dart_GetNativeInstanceField(
23 ASSERT_FALSE(Dart_IsError(result));
26 ASSERT_EQ(nodes.size(),
static_cast<size_t>(1));
27 auto found = nodes.find(0);
28 ASSERT_NE(found, nodes.end());
31 ASSERT_EQ(node.
label,
"label");
37 ASSERT_EQ(node.
value,
"value");
43 ASSERT_EQ(node.
hint,
"hint");
48 auto local_attribute =
49 std::static_pointer_cast<LocaleStringAttribute>(node.
hintAttributes[0]);
50 ASSERT_EQ(local_attribute->locale,
"en-MX");
65 message_latch->Signal();
68 Settings settings = CreateSettingsForFixture();
70 GetCurrentTaskRunner(),
76 AddNativeCallback(
"SemanticsUpdate",
79 std::unique_ptr<Shell> shell = CreateShell(settings, task_runners);
81 ASSERT_TRUE(shell->IsSetup());
83 configuration.SetEntrypoint(
"sendSemanticsUpdate");
85 shell->RunEngine(std::move(configuration), [](
auto result) {
89 message_latch->Wait();
90 DestroyShell(std::move(shell), task_runners);
94 auto message_latch = std::make_shared<fml::AutoResetWaitableEvent>();
96 auto nativeSemanticsUpdate = [message_latch](Dart_NativeArguments
args) {
97 auto handle = Dart_GetNativeArgument(
args, 0);
99 Dart_Handle result = Dart_GetNativeInstanceField(
101 ASSERT_FALSE(Dart_IsError(result));
104 auto found = nodes.find(0);
105 ASSERT_NE(found, nodes.end());
109 message_latch->Signal();
112 Settings settings = CreateSettingsForFixture();
114 GetCurrentTaskRunner(),
120 AddNativeCallback(
"SemanticsUpdate",
123 std::unique_ptr<Shell> shell = CreateShell(settings, task_runners);
125 ASSERT_TRUE(shell->IsSetup());
127 configuration.SetEntrypoint(
"sendSemanticsUpdateWithRole");
133 message_latch->Wait();
134 DestroyShell(std::move(shell), task_runners);
138 auto message_latch = std::make_shared<fml::AutoResetWaitableEvent>();
140 auto nativeSemanticsUpdate = [message_latch](Dart_NativeArguments
args) {
141 auto handle = Dart_GetNativeArgument(
args, 0);
143 Dart_Handle result = Dart_GetNativeInstanceField(
145 ASSERT_FALSE(Dart_IsError(result));
148 ASSERT_EQ(nodes.size(),
static_cast<size_t>(1));
149 auto found = nodes.find(0);
150 ASSERT_NE(found, nodes.end());
153 ASSERT_EQ(node.
locale,
"es-MX");
154 message_latch->Signal();
157 Settings settings = CreateSettingsForFixture();
159 GetCurrentTaskRunner(),
165 AddNativeCallback(
"SemanticsUpdate",
168 std::unique_ptr<Shell> shell = CreateShell(settings, task_runners);
170 ASSERT_TRUE(shell->IsSetup());
172 configuration.SetEntrypoint(
"sendSemanticsUpdateWithLocale");
178 message_latch->Wait();
179 DestroyShell(std::move(shell), task_runners);
183 auto message_latch = std::make_shared<fml::AutoResetWaitableEvent>();
185 auto nativeSemanticsUpdate = [message_latch](Dart_NativeArguments
args) {
186 auto handle = Dart_GetNativeArgument(
args, 0);
188 Dart_Handle result = Dart_GetNativeInstanceField(
190 ASSERT_FALSE(Dart_IsError(result));
193 ASSERT_EQ(nodes.size(),
static_cast<size_t>(1));
194 auto found = nodes.find(0);
195 ASSERT_NE(found, nodes.end());
199 message_latch->Signal();
202 Settings settings = CreateSettingsForFixture();
204 GetCurrentTaskRunner(),
210 AddNativeCallback(
"SemanticsUpdate",
213 std::unique_ptr<Shell> shell = CreateShell(settings, task_runners);
215 ASSERT_TRUE(shell->IsSetup());
217 configuration.SetEntrypoint(
"sendSemanticsUpdateWithIsLink");
223 message_latch->Wait();
224 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...