diff --git a/shell/platform/embedder/embedder.cc b/shell/platform/embedder/embedder.cc index 3511162c89d40..6240bc9efcf80 100644 --- a/shell/platform/embedder/embedder.cc +++ b/shell/platform/embedder/embedder.cc @@ -1292,6 +1292,7 @@ FlutterSemanticsNode CreateEmbedderSemanticsNode( node.customAccessibilityActions.size(), node.customAccessibilityActions.data(), node.platformViewId, + node.tooltip.c_str(), }; } diff --git a/shell/platform/embedder/fixtures/main.dart b/shell/platform/embedder/fixtures/main.dart index a8098c8fda34f..1726c5637389b 100644 --- a/shell/platform/embedder/fixtures/main.dart +++ b/shell/platform/embedder/fixtures/main.dart @@ -165,7 +165,7 @@ void a11y_main() async { increasedValueAttributes: [], decreasedValue: '', decreasedValueAttributes: [], - tooltip: '', + tooltip: 'tooltip', additionalActions: Int32List(0), ) ..updateNode( @@ -196,7 +196,7 @@ void a11y_main() async { increasedValueAttributes: [], decreasedValue: '', decreasedValueAttributes: [], - tooltip: '', + tooltip: 'tooltip', additionalActions: Int32List(0), childrenInHitTestOrder: Int32List(0), childrenInTraversalOrder: Int32List(0), @@ -231,7 +231,7 @@ void a11y_main() async { increasedValueAttributes: [], decreasedValue: '', decreasedValueAttributes: [], - tooltip: '', + tooltip: 'tooltip', additionalActions: Int32List(0), ) ..updateNode( @@ -263,7 +263,7 @@ void a11y_main() async { increasedValueAttributes: [], decreasedValue: '', decreasedValueAttributes: [], - tooltip: '', + tooltip: 'tooltip', childrenInHitTestOrder: Int32List(0), childrenInTraversalOrder: Int32List(0), ) diff --git a/shell/platform/embedder/tests/embedder_a11y_unittests.cc b/shell/platform/embedder/tests/embedder_a11y_unittests.cc index a4c3588032d8c..4007bb9e0c23c 100644 --- a/shell/platform/embedder/tests/embedder_a11y_unittests.cc +++ b/shell/platform/embedder/tests/embedder_a11y_unittests.cc @@ -24,6 +24,8 @@ namespace testing { using EmbedderA11yTest = testing::EmbedderTest; +constexpr static char kTooltip[] = "tooltip"; + TEST_F(EmbedderTest, CannotProvideNewAndLegacySemanticsCallback) { EmbedderConfigBuilder builder( GetEmbedderContext(EmbedderTestContextType::kSoftwareContext)); @@ -101,6 +103,7 @@ TEST_F(EmbedderA11yTest, A11yTreeIsConsistent) { ASSERT_EQ(7.0, node->transform.pers0); ASSERT_EQ(8.0, node->transform.pers1); ASSERT_EQ(9.0, node->transform.pers2); + ASSERT_EQ(std::strncmp(kTooltip, node->tooltip, sizeof(kTooltip) - 1), 0); if (node->id == 128) { ASSERT_EQ(0x3f3, node->platform_view_id); @@ -285,6 +288,7 @@ TEST_F(EmbedderA11yTest, A11yTreeIsConsistentUsingLegacyCallbacks) { ASSERT_EQ(7.0, node->transform.pers0); ASSERT_EQ(8.0, node->transform.pers1); ASSERT_EQ(9.0, node->transform.pers2); + ASSERT_EQ(std::strncmp(kTooltip, node->tooltip, sizeof(kTooltip) - 1), 0); if (node->id == 128) { ASSERT_EQ(0x3f3, node->platform_view_id);