5#include "flutter/lib/ui/semantics/semantics_update_builder.h"
6#include "flutter/shell/common/shell_test.h"
8#include "gtest/gtest.h"
16 auto message_latch = std::make_shared<fml::AutoResetWaitableEvent>();
26 ASSERT_EQ(nodes.size(), (
size_t)1);
27 auto node = nodes.find(0)->second;
29 ASSERT_EQ(node.label,
"label");
30 ASSERT_EQ(node.labelAttributes.size(), (
size_t)1);
31 ASSERT_EQ(node.labelAttributes[0]->start, 1);
32 ASSERT_EQ(node.labelAttributes[0]->end, 2);
35 ASSERT_EQ(node.value,
"value");
36 ASSERT_EQ(node.valueAttributes.size(), (
size_t)1);
37 ASSERT_EQ(node.valueAttributes[0]->start, 2);
38 ASSERT_EQ(node.valueAttributes[0]->end, 3);
41 ASSERT_EQ(node.hint,
"hint");
42 ASSERT_EQ(node.hintAttributes.size(), (
size_t)1);
43 ASSERT_EQ(node.hintAttributes[0]->start, 0);
44 ASSERT_EQ(node.hintAttributes[0]->end, 1);
46 auto local_attribute =
47 std::static_pointer_cast<LocaleStringAttribute>(node.hintAttributes[0]);
48 ASSERT_EQ(local_attribute->locale,
"en-MX");
50 ASSERT_EQ(node.increasedValue,
"increasedValue");
51 ASSERT_EQ(node.increasedValueAttributes.size(), (
size_t)1);
52 ASSERT_EQ(node.increasedValueAttributes[0]->start, 4);
53 ASSERT_EQ(node.increasedValueAttributes[0]->end, 5);
54 ASSERT_EQ(node.increasedValueAttributes[0]->type,
57 ASSERT_EQ(node.decreasedValue,
"decreasedValue");
58 ASSERT_EQ(node.decreasedValueAttributes.size(), (
size_t)1);
59 ASSERT_EQ(node.decreasedValueAttributes[0]->start, 5);
60 ASSERT_EQ(node.decreasedValueAttributes[0]->end, 6);
61 ASSERT_EQ(node.decreasedValueAttributes[0]->type,
63 message_latch->Signal();
74 AddNativeCallback(
"SemanticsUpdate",
77 std::unique_ptr<Shell>
shell = CreateShell(
settings, task_runners);
79 ASSERT_TRUE(
shell->IsSetup());
81 configuration.SetEntrypoint(
"sendSemanticsUpdate");
83 shell->RunEngine(std::move(configuration), [](
auto result) {
87 message_latch->Wait();
88 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...
struct _Dart_Handle * Dart_Handle
DART_EXPORT Dart_Handle Dart_GetNativeArgument(Dart_NativeArguments args, int index)
DART_EXPORT Dart_Handle Dart_GetNativeInstanceField(Dart_Handle obj, int index, intptr_t *value)
struct _Dart_NativeArguments * Dart_NativeArguments
DART_EXPORT bool Dart_IsError(Dart_Handle handle)
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
fml::RefPtr< fml::TaskRunner > CreateNewThread(const std::string &name)
fml::RefPtr< fml::TaskRunner > GetCurrentTaskRunner()
TEST_F(DisplayListTest, Defaults)
std::unordered_map< int32_t, SemanticsNode > SemanticsNodeUpdates
#define CREATE_NATIVE_ENTRY(native_entry)