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

Add back tooltip to Embedder #37676

Merged
merged 4 commits into from
Nov 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions shell/platform/embedder/embedder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1292,6 +1292,7 @@ FlutterSemanticsNode CreateEmbedderSemanticsNode(
node.customAccessibilityActions.size(),
node.customAccessibilityActions.data(),
node.platformViewId,
node.tooltip.c_str(),
Copy link
Member

@loic-sharma loic-sharma Nov 16, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we test this by updating the Dart fixture to have a node with a tooltip and verifying that in accessibility test?

};
}

Expand Down
8 changes: 4 additions & 4 deletions shell/platform/embedder/fixtures/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ void a11y_main() async {
increasedValueAttributes: <StringAttribute>[],
decreasedValue: '',
decreasedValueAttributes: <StringAttribute>[],
tooltip: '',
tooltip: 'tooltip',
additionalActions: Int32List(0),
)
..updateNode(
Expand Down Expand Up @@ -196,7 +196,7 @@ void a11y_main() async {
increasedValueAttributes: <StringAttribute>[],
decreasedValue: '',
decreasedValueAttributes: <StringAttribute>[],
tooltip: '',
tooltip: 'tooltip',
additionalActions: Int32List(0),
childrenInHitTestOrder: Int32List(0),
childrenInTraversalOrder: Int32List(0),
Expand Down Expand Up @@ -231,7 +231,7 @@ void a11y_main() async {
increasedValueAttributes: <StringAttribute>[],
decreasedValue: '',
decreasedValueAttributes: <StringAttribute>[],
tooltip: '',
tooltip: 'tooltip',
additionalActions: Int32List(0),
)
..updateNode(
Expand Down Expand Up @@ -263,7 +263,7 @@ void a11y_main() async {
increasedValueAttributes: <StringAttribute>[],
decreasedValue: '',
decreasedValueAttributes: <StringAttribute>[],
tooltip: '',
tooltip: 'tooltip',
childrenInHitTestOrder: Int32List(0),
childrenInTraversalOrder: Int32List(0),
)
Expand Down
4 changes: 4 additions & 0 deletions shell/platform/embedder/tests/embedder_a11y_unittests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ namespace testing {

using EmbedderA11yTest = testing::EmbedderTest;

constexpr static char kTooltip[] = "tooltip";

TEST_F(EmbedderTest, CannotProvideNewAndLegacySemanticsCallback) {
EmbedderConfigBuilder builder(
GetEmbedderContext(EmbedderTestContextType::kSoftwareContext));
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down