#include "ui/accessibility/ax_tree.h"
#include "base/containers/contains.h"
#include "base/test/metrics/histogram_tester.h"
#include "testing/gmock/include/gmock/gmock-matchers.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/accessibility/ax_enum_util.h"
#include "ui/accessibility/ax_node.h"
#include "ui/accessibility/ax_serializable_tree.h"
#include "ui/accessibility/ax_tree_observer.h"
#include "ui/accessibility/ax_tree_serializer.h"
namespace ui {
namespace {
std::string IntVectorToString(const std::vector<int>& items) { … }
std::string GetBoundsAsString(const AXTree& tree, int32_t id) { … }
std::string GetUnclippedBoundsAsString(const AXTree& tree, int32_t id) { … }
bool IsNodeOffscreen(const AXTree& tree, int32_t id) { … }
void AssertReverseRelationFor(ax::mojom::IntListAttribute relation) { … }
class TestAXTreeObserver final : public AXTreeObserver { … };
enum class TestEncoding { … };
class AXTreeTestWithMultipleUTFEncodings
: public ::testing::TestWithParam<TestEncoding> { … };
}
ElementsAre;
#define EXPECT_OPTIONAL_EQ(expected, actual) …
TEST(AXTreeTest, SerializeSimpleAXTree) { … }
TEST(AXTreeTest, SerializeAXTreeUpdate) { … }
TEST(AXTreeTest, LeaveOrphanedDeletedSubtreeFails) { … }
TEST(AXTreeTest, LeaveOrphanedNewChildFails) { … }
TEST(AXTreeTest, DuplicateChildIdFails) { … }
TEST(AXTreeTest, InvalidReparentingFails) { … }
TEST(AXTreeTest, NoReparentingOfRootIfNoNewRoot) { … }
TEST(AXTreeTest, NoReparentingIfOnlyRemovedAndChangedNotReAdded) { … }
TEST(AXTreeTest, NoReparentingIfRemovedMultipleTimesAndNotInFinalTree) { … }
TEST(AXTreeTest, ReparentIfRemovedMultipleTimesButExistsInFinalTree) { … }
TEST(AXTreeTest, ReparentRootIfRootChanged) { … }
TEST(AXTreeTest, ImplicitChildrenDelete) { … }
TEST(AXTreeTest, IndexInParentAfterReorder) { … }
TEST(AXTreeTest, IndexInParentAfterReorderIgnoredNode) { … }
TEST(AXTreeTest, ImplicitAttributeDelete) { … }
TEST(AXTreeTest, TreeObserverIsCalled) { … }
TEST(AXTreeTest, TreeObserverIsCalledForTreeDataChanges) { … }
TEST(AXTreeTest, ReparentingDoesNotTriggerNodeCreated) { … }
TEST(AXTreeTest, MultipleIgnoredChangesDoesNotBreakCache) { … }
TEST(AXTreeTest, NodeToClearUpdatesParentUnignoredCount) { … }
TEST(AXTreeTest, TreeObserverIsNotCalledForReparenting) { … }
TEST(AXTreeTest, DISABLED_BogusAXTree) { … }
TEST(AXTreeTest, BogusAXTree2) { … }
TEST(AXTreeTest, BogusAXTree3) { … }
TEST(AXTreeTest, RoleAndStateChangeCallbacks) { … }
TEST(AXTreeTest, AttributeChangeCallbacks) { … }
TEST(AXTreeTest, IntListChangeCallbacks) { … }
TEST(AXTreeTest, GetBoundsBasic) { … }
TEST(AXTreeTest, EmptyNodeBoundsIsUnionOfChildren) { … }
TEST(AXTreeTest, EmptyNodeNotOffscreenEvenIfAllChildrenOffscreen) { … }
TEST(AXTreeTest, GetBoundsWithTransform) { … }
TEST(AXTreeTest, GetBoundsWithContainerId) { … }
TEST(AXTreeTest, GetBoundsWithScrolling) { … }
TEST(AXTreeTest, GetBoundsOfNodeWithZeroSize) { … }
TEST(AXTreeTest, GetBoundsEmptyBoundsInheritsFromParent) { … }
TEST(AXTreeTest, GetBoundsCropsChildToRoot) { … }
TEST(AXTreeTest, GetBoundsSetsOffscreenIfClipsChildren) { … }
TEST(AXTreeTest, GetBoundsUpdatesOffscreen) { … }
TEST(AXTreeTest, IntReverseRelations) { … }
TEST(AXTreeTest, IntListReverseRelations) { … }
TEST(AXTreeTest, DeletingNodeUpdatesReverseRelations) { … }
TEST(AXTreeTest, ReverseRelationsDoNotKeepGrowing) { … }
TEST(AXTreeTest, SkipIgnoredNodes) { … }
TEST(AXTreeTest, CachedUnignoredValues) { … }
TEST(AXTreeTest, TestRecursionUnignoredChildCount) { … }
TEST(AXTreeTest, NullUnignoredChildren) { … }
TEST(AXTreeTest, UnignoredChildIteratorIncrementDecrementPastEnd) { … }
TEST(AXTreeTest, UnignoredChildIteratorIgnoredContainerSiblings) { … }
TEST(AXTreeTest, UnignoredChildIterator) { … }
TEST(AXTreeTest, UnignoredAccessors) { … }
TEST(AXTreeTest, UnignoredNextPreviousChild) { … }
TEST(AXTreeTest, GetSiblingsNoIgnored) { … }
TEST(AXTreeTest, GetUnignoredSiblingsChildrenPromoted) { … }
TEST(AXTreeTest, GetUnignoredSiblingsIgnoredChildSkipped) { … }
TEST(AXTreeTest, GetUnignoredSiblingIgnoredParentIrrelevant) { … }
TEST(AXTreeTest, GetUnignoredSiblingsAllIgnored) { … }
TEST(AXTreeTest, GetUnignoredSiblingsNestedIgnored) { … }
TEST(AXTreeTest, GetChildrenOrSiblings) { … }
TEST(AXTreeTest, ChildTreeIds) { … }
TEST_P(AXTreeTestWithMultipleUTFEncodings, ComputedNodeData) { … }
INSTANTIATE_TEST_SUITE_P(…);
TEST(AXTreeTest, SetSizePosInSetAssigned) { … }
TEST(AXTreeTest, SetSizePosInSetUnassigned) { … }
TEST(AXTreeTest, SetSizePosInSetInTreeGridUnassigned) { … }
TEST(AXTreeTest, SetSizeAssignedOnContainer) { … }
TEST(AXTreeTest, SetSizePosInSetDiverseList) { … }
TEST(AXTreeTest, SetSizePosInSetNestedList) { … }
TEST(AXTreeTest, PosInSetMissing) { … }
TEST(AXTreeTest, SetSizePosInSetMissingDifficult) { … }
TEST(AXTreeTest, SetSizeDecreasing) { … }
TEST(AXTreeTest, PosInSetDecreasing) { … }
TEST(AXTreeTest, PosInSetDuplicates) { … }
TEST(AXTreeTest, SetSizePosInSetNestedContainer) { … }
TEST(AXTreeTest, SetSizePosInSetDeleteItem) { … }
TEST(AXTreeTest, SetSizePosInSetAddItem) { … }
TEST(AXTreeTest, OrderedSetReportsSetSize) { … }
TEST(AXTreeTest, SetSizePosInSetInvalid) { … }
TEST(AXTreeTest, SetSizePosInSetRadioButtons) { … }
TEST(AXTreeTest, SetSizePosInSetRadioButtonsInList) { … }
TEST(AXTreeTest, SetSizePosInSetFlatTree) { … }
TEST(AXTreeTest, SetSizePosInSetFlatTreeLevelsOnly) { … }
TEST(AXTreeTest, SetSizePosInSetSubtreeDeleted) { … }
TEST(AXTreeTest, SetSizePosInSetIgnoredItem) { … }
TEST(AXTreeTest, SetSizePosInSetPopUpButtonAndSelect) { … }
TEST(AXTreeTest, SetSizePosInSetUnkown) { … }
TEST(AXTreeTest, SetSizePosInSetMenuItemValidChildOfMenuListPopup) { … }
TEST(AXTreeTest, SetSizePostInSetListBoxOptionWithGroup) { … }
TEST(AXTreeTest, SetSizePosInSetGroup) { … }
TEST(AXTreeTest, SetSizePosInSetHidden) { … }
TEST(AXTreeTest, SetSizePosInSetControls) { … }
TEST(AXTreeTest, SetSizePosInSetLeafPopUpButton) { … }
TEST(AXTreeTest, OnNodeWillBeDeletedHasValidUnignoredParent) { … }
TEST(AXTreeTest, OnNodeHasBeenDeleted) { … }
TEST(AXTreeTest, SingleUpdateDeletesNewlyCreatedChildNode) { … }
TEST(AXTreeTest, SingleUpdateReparentsNodeMultipleTimes) { … }
TEST(AXTreeTest, SingleUpdateIgnoresNewlyCreatedUnignoredChildNode) { … }
TEST(AXTreeTest, SingleUpdateTogglesIgnoredStateAfterCreatingNode) { … }
TEST(AXTreeTest, SingleUpdateTogglesIgnoredStateBeforeDestroyingNode) { … }
TEST(AXTreeTest, TestIsInListMarker) { … }
TEST(AXTreeTest, UpdateFromOutOfSyncTree) { … }
TEST(AXTreeTest, UnserializeErrors) { … }
}