Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit d7f49f6

Browse files
Add back tooltip to Embedder (#37676)
* Add back tooltip to Embedder * Test inclusion of tooltip data * Change to constexpr * Lint
1 parent fee4635 commit d7f49f6

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

shell/platform/embedder/embedder.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1292,6 +1292,7 @@ FlutterSemanticsNode CreateEmbedderSemanticsNode(
12921292
node.customAccessibilityActions.size(),
12931293
node.customAccessibilityActions.data(),
12941294
node.platformViewId,
1295+
node.tooltip.c_str(),
12951296
};
12961297
}
12971298

shell/platform/embedder/fixtures/main.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ void a11y_main() async {
165165
increasedValueAttributes: <StringAttribute>[],
166166
decreasedValue: '',
167167
decreasedValueAttributes: <StringAttribute>[],
168-
tooltip: '',
168+
tooltip: 'tooltip',
169169
additionalActions: Int32List(0),
170170
)
171171
..updateNode(
@@ -196,7 +196,7 @@ void a11y_main() async {
196196
increasedValueAttributes: <StringAttribute>[],
197197
decreasedValue: '',
198198
decreasedValueAttributes: <StringAttribute>[],
199-
tooltip: '',
199+
tooltip: 'tooltip',
200200
additionalActions: Int32List(0),
201201
childrenInHitTestOrder: Int32List(0),
202202
childrenInTraversalOrder: Int32List(0),
@@ -231,7 +231,7 @@ void a11y_main() async {
231231
increasedValueAttributes: <StringAttribute>[],
232232
decreasedValue: '',
233233
decreasedValueAttributes: <StringAttribute>[],
234-
tooltip: '',
234+
tooltip: 'tooltip',
235235
additionalActions: Int32List(0),
236236
)
237237
..updateNode(
@@ -263,7 +263,7 @@ void a11y_main() async {
263263
increasedValueAttributes: <StringAttribute>[],
264264
decreasedValue: '',
265265
decreasedValueAttributes: <StringAttribute>[],
266-
tooltip: '',
266+
tooltip: 'tooltip',
267267
childrenInHitTestOrder: Int32List(0),
268268
childrenInTraversalOrder: Int32List(0),
269269
)

shell/platform/embedder/tests/embedder_a11y_unittests.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ namespace testing {
2424

2525
using EmbedderA11yTest = testing::EmbedderTest;
2626

27+
constexpr static char kTooltip[] = "tooltip";
28+
2729
TEST_F(EmbedderTest, CannotProvideNewAndLegacySemanticsCallback) {
2830
EmbedderConfigBuilder builder(
2931
GetEmbedderContext(EmbedderTestContextType::kSoftwareContext));
@@ -101,6 +103,7 @@ TEST_F(EmbedderA11yTest, A11yTreeIsConsistent) {
101103
ASSERT_EQ(7.0, node->transform.pers0);
102104
ASSERT_EQ(8.0, node->transform.pers1);
103105
ASSERT_EQ(9.0, node->transform.pers2);
106+
ASSERT_EQ(std::strncmp(kTooltip, node->tooltip, sizeof(kTooltip) - 1), 0);
104107

105108
if (node->id == 128) {
106109
ASSERT_EQ(0x3f3, node->platform_view_id);
@@ -285,6 +288,7 @@ TEST_F(EmbedderA11yTest, A11yTreeIsConsistentUsingLegacyCallbacks) {
285288
ASSERT_EQ(7.0, node->transform.pers0);
286289
ASSERT_EQ(8.0, node->transform.pers1);
287290
ASSERT_EQ(9.0, node->transform.pers2);
291+
ASSERT_EQ(std::strncmp(kTooltip, node->tooltip, sizeof(kTooltip) - 1), 0);
288292

289293
if (node->id == 128) {
290294
ASSERT_EQ(0x3f3, node->platform_view_id);

0 commit comments

Comments
 (0)