Skip to content

Commit

Permalink
[Linux] add missing ATK_STATE_SENSITIVE flag (flutter#32487)
Browse files Browse the repository at this point in the history
  • Loading branch information
jpnurmi authored Apr 26, 2022
1 parent 07584c6 commit 46b0889
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions shell/platform/linux/fl_accessible_node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ static struct {
FALSE},
{ATK_STATE_SELECTED, kFlutterSemanticsFlagIsSelected, FALSE},
{ATK_STATE_ENABLED, kFlutterSemanticsFlagIsEnabled, FALSE},
{ATK_STATE_SENSITIVE, kFlutterSemanticsFlagIsEnabled, FALSE},
{ATK_STATE_READ_ONLY, kFlutterSemanticsFlagIsReadOnly, FALSE},
{ATK_STATE_INVALID, static_cast<FlutterSemanticsFlag>(0), FALSE},
};
Expand Down
5 changes: 4 additions & 1 deletion shell/platform/linux/fl_accessible_node_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,13 @@ TEST(FlAccessibleNodeTest, SetFlags) {

g_autoptr(FlAccessibleNode) node = fl_accessible_node_new(engine, 0);
fl_accessible_node_set_flags(
node, static_cast<FlutterSemanticsFlag>(kFlutterSemanticsFlagIsFocusable |
node, static_cast<FlutterSemanticsFlag>(kFlutterSemanticsFlagIsEnabled |
kFlutterSemanticsFlagIsFocusable |
kFlutterSemanticsFlagIsFocused));

AtkStateSet* state = atk_object_ref_state_set(ATK_OBJECT(node));
EXPECT_TRUE(atk_state_set_contains_state(state, ATK_STATE_ENABLED));
EXPECT_TRUE(atk_state_set_contains_state(state, ATK_STATE_SENSITIVE));
EXPECT_TRUE(atk_state_set_contains_state(state, ATK_STATE_FOCUSABLE));
EXPECT_TRUE(atk_state_set_contains_state(state, ATK_STATE_FOCUSED));
EXPECT_TRUE(!atk_state_set_contains_state(state, ATK_STATE_CHECKED));
Expand Down

0 comments on commit 46b0889

Please sign in to comment.