blob: 13e51dc48617491a0afe994e6726bf169bf9f3ef [file] [log] [blame]
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ui/accessibility/ax_node_data.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/accessibility/ax_enums.mojom.h"
namespace ui {
TEST(AXNodeDataTest, GetAndSetCheckedState) {
AXNodeData root;
EXPECT_EQ(ax::mojom::CheckedState::kNone, root.GetCheckedState());
EXPECT_FALSE(root.HasIntAttribute(ax::mojom::IntAttribute::kCheckedState));
root.SetCheckedState(ax::mojom::CheckedState::kMixed);
EXPECT_EQ(ax::mojom::CheckedState::kMixed, root.GetCheckedState());
EXPECT_TRUE(root.HasIntAttribute(ax::mojom::IntAttribute::kCheckedState));
root.SetCheckedState(ax::mojom::CheckedState::kFalse);
EXPECT_EQ(ax::mojom::CheckedState::kFalse, root.GetCheckedState());
EXPECT_TRUE(root.HasIntAttribute(ax::mojom::IntAttribute::kCheckedState));
root.SetCheckedState(ax::mojom::CheckedState::kNone);
EXPECT_EQ(ax::mojom::CheckedState::kNone, root.GetCheckedState());
EXPECT_FALSE(root.HasIntAttribute(ax::mojom::IntAttribute::kCheckedState));
}
} // namespace ui