未验证 提交 1eaef558 编写于 作者: A Alexander Brusher 提交者: GitHub

[fuchsia] Populates fuchsia node is_keyboard_key in accessibility bridge. (#25334)

This change sets the fuchsia node attribute is_keyboard_key in the
accessibility bridge.
上级 53674215
......@@ -81,6 +81,10 @@ AccessibilityBridge::GetNodeAttributes(const flutter::SemanticsNode& node,
*added_size += node.label.size();
}
if (node.HasFlag(flutter::SemanticsFlags::kIsKeyboardKey)) {
attributes.set_is_keyboard_key(true);
}
return attributes;
}
......
......@@ -113,6 +113,21 @@ TEST_F(AccessibilityBridgeTest, RequestAnnounce) {
EXPECT_EQ(last_events[0].announce().message(), "message");
}
TEST_F(AccessibilityBridgeTest, PopulatesIsKeyboardKeyAttribute) {
flutter::SemanticsNode node0;
node0.id = 0;
node0.flags = static_cast<int>(flutter::SemanticsFlags::kIsKeyboardKey);
accessibility_bridge_->AddSemanticsNodeUpdate({{0, node0}}, 1.f);
RunLoopUntilIdle();
EXPECT_EQ(1U, semantics_manager_.LastUpdatedNodes().size());
const auto& fuchsia_node = semantics_manager_.LastUpdatedNodes().at(0u);
EXPECT_EQ(fuchsia_node.node_id(), static_cast<unsigned int>(node0.id));
EXPECT_TRUE(fuchsia_node.has_attributes());
EXPECT_TRUE(fuchsia_node.attributes().is_keyboard_key());
}
TEST_F(AccessibilityBridgeTest, UpdatesNodeRoles) {
flutter::SemanticsNodeUpdates updates;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册