Flutter Engine
The Flutter Engine
Namespaces | Macros | Functions
ax_tree_unittest.cc File Reference
#include "ax_tree.h"
#include <cstddef>
#include <cstdint>
#include <memory>
#include "ax_enum_util.h"
#include "ax_node.h"
#include "ax_node_position.h"
#include "ax_tree_data.h"
#include "ax_tree_id.h"
#include "ax_tree_observer.h"
#include "base/string_utils.h"
#include "gtest/gtest.h"
#include "test_ax_tree_manager.h"

Go to the source code of this file.

Namespaces

namespace  ui
 

Macros

#define TEST_SELECTION(tree_update, tree, input, expected)
 
#define EXPECT_OPTIONAL_EQ(expected, actual)
 

Functions

 ui::TEST (AXTreeTest, SerializeAXTreeUpdate)
 
 ui::TEST (AXTreeTest, LeaveOrphanedDeletedSubtreeFails)
 
 ui::TEST (AXTreeTest, LeaveOrphanedNewChildFails)
 
 ui::TEST (AXTreeTest, DuplicateChildIdFails)
 
 ui::TEST (AXTreeTest, InvalidReparentingFails)
 
 ui::TEST (AXTreeTest, NoReparentingOfRootIfNoNewRoot)
 
 ui::TEST (AXTreeTest, NoReparentingIfOnlyRemovedAndChangedNotReAdded)
 
 ui::TEST (AXTreeTest, NoReparentingIfRemovedMultipleTimesAndNotInFinalTree)
 
 ui::TEST (AXTreeTest, ReparentIfRemovedMultipleTimesButExistsInFinalTree)
 
 ui::TEST (AXTreeTest, ReparentRootIfRootChanged)
 
 ui::TEST (AXTreeTest, ImplicitChildrenDelete)
 
 ui::TEST (AXTreeTest, IndexInParentAfterReorder)
 
 ui::TEST (AXTreeTest, IndexInParentAfterReorderIgnoredNode)
 
 ui::TEST (AXTreeTest, ImplicitAttributeDelete)
 
 ui::TEST (AXTreeTest, TreeObserverIsCalled)
 
 ui::TEST (AXTreeTest, TreeObserverIsCalledForTreeDataChanges)
 
 ui::TEST (AXTreeTest, ReparentingDoesNotTriggerNodeCreated)
 
 ui::TEST (AXTreeTest, MultipleIgnoredChangesDoesNotBreakCache)
 
 ui::TEST (AXTreeTest, NodeToClearUpdatesParentUnignoredCount)
 
 ui::TEST (AXTreeTest, TreeObserverIsNotCalledForReparenting)
 
 ui::TEST (AXTreeTest, BogusAXTree)
 
 ui::TEST (AXTreeTest, BogusAXTree2)
 
 ui::TEST (AXTreeTest, BogusAXTree3)
 
 ui::TEST (AXTreeTest, RoleAndStateChangeCallbacks)
 
 ui::TEST (AXTreeTest, AttributeChangeCallbacks)
 
 ui::TEST (AXTreeTest, IntListChangeCallbacks)
 
 ui::TEST (AXTreeTest, GetBoundsBasic)
 
 ui::TEST (AXTreeTest, EmptyNodeBoundsIsUnionOfChildren)
 
 ui::TEST (AXTreeTest, EmptyNodeNotOffscreenEvenIfAllChildrenOffscreen)
 
 ui::TEST (AXTreeTest, GetBoundsWithTransform)
 
 ui::TEST (AXTreeTest, GetBoundsWithContainerId)
 
 ui::TEST (AXTreeTest, GetBoundsWithScrolling)
 
 ui::TEST (AXTreeTest, GetBoundsOfNodeWithZeroSize)
 
 ui::TEST (AXTreeTest, GetBoundsEmptyBoundsInheritsFromParent)
 
 ui::TEST (AXTreeTest, GetBoundsCropsChildToRoot)
 
 ui::TEST (AXTreeTest, GetBoundsSetsOffscreenIfClipsChildren)
 
 ui::TEST (AXTreeTest, GetBoundsUpdatesOffscreen)
 
 ui::TEST (AXTreeTest, IntReverseRelations)
 
 ui::TEST (AXTreeTest, IntListReverseRelations)
 
 ui::TEST (AXTreeTest, DeletingNodeUpdatesReverseRelations)
 
 ui::TEST (AXTreeTest, ReverseRelationsDoNotKeepGrowing)
 
 ui::TEST (AXTreeTest, SkipIgnoredNodes)
 
 ui::TEST (AXTreeTest, CachedUnignoredValues)
 
 ui::TEST (AXTreeTest, TestRecursionUnignoredChildCount)
 
 ui::TEST (AXTreeTest, NullUnignoredChildren)
 
 ui::TEST (AXTreeTest, UnignoredChildIteratorIncrementDecrementPastEnd)
 
 ui::TEST (AXTreeTest, UnignoredChildIteratorIgnoredContainerSiblings)
 
 ui::TEST (AXTreeTest, UnignoredChildIterator)
 
 ui::TEST (AXTreeTest, UnignoredAccessors)
 
 ui::TEST (AXTreeTest, UnignoredNextPreviousChild)
 
 ui::TEST (AXTreeTest, GetSiblingsNoIgnored)
 
 ui::TEST (AXTreeTest, GetUnignoredSiblingsChildrenPromoted)
 
 ui::TEST (AXTreeTest, GetUnignoredSiblingsIgnoredChildSkipped)
 
 ui::TEST (AXTreeTest, GetUnignoredSiblingIgnoredParentIrrelevant)
 
 ui::TEST (AXTreeTest, GetUnignoredSiblingsAllIgnored)
 
 ui::TEST (AXTreeTest, GetUnignoredSiblingsNestedIgnored)
 
 ui::TEST (AXTreeTest, UnignoredSelection)
 
 ui::TEST (AXTreeTest, GetChildrenOrSiblings)
 
 ui::TEST (AXTreeTest, SetSizePosInSetAssigned)
 
 ui::TEST (AXTreeTest, SetSizePosInSetUnassigned)
 
 ui::TEST (AXTreeTest, SetSizeAssignedOnContainer)
 
 ui::TEST (AXTreeTest, SetSizePosInSetDiverseList)
 
 ui::TEST (AXTreeTest, SetSizePosInSetNestedList)
 
 ui::TEST (AXTreeTest, PosInSetMissing)
 
 ui::TEST (AXTreeTest, SetSizePosInSetMissingDifficult)
 
 ui::TEST (AXTreeTest, SetSizeDecreasing)
 
 ui::TEST (AXTreeTest, PosInSetDecreasing)
 
 ui::TEST (AXTreeTest, PosInSetDuplicates)
 
 ui::TEST (AXTreeTest, SetSizePosInSetNestedContainer)
 
 ui::TEST (AXTreeTest, SetSizePosInSetDeleteItem)
 
 ui::TEST (AXTreeTest, SetSizePosInSetAddItem)
 
 ui::TEST (AXTreeTest, OrderedSetReportsSetSize)
 
 ui::TEST (AXTreeTest, SetSizePosInSetInvalid)
 
 ui::TEST (AXTreeTest, SetSizePosInSetRadioButtons)
 
 ui::TEST (AXTreeTest, SetSizePosInSetRadioButtonsInList)
 
 ui::TEST (AXTreeTest, SetSizePosInSetFlatTree)
 
 ui::TEST (AXTreeTest, SetSizePosInSetFlatTreeLevelsOnly)
 
 ui::TEST (AXTreeTest, SetSizePosInSetSubtreeDeleted)
 
 ui::TEST (AXTreeTest, SetSizePosInSetIgnoredItem)
 
 ui::TEST (AXTreeTest, SetSizePosInSetPopUpButton)
 
 ui::TEST (AXTreeTest, SetSizePosInSetUnkown)
 
 ui::TEST (AXTreeTest, SetSizePosInSetMenuItemValidChildOfMenuListPopup)
 
 ui::TEST (AXTreeTest, SetSizePostInSetListBoxOptionWithGroup)
 
 ui::TEST (AXTreeTest, SetSizePosInSetGroup)
 
 ui::TEST (AXTreeTest, SetSizePosInSetHidden)
 
 ui::TEST (AXTreeTest, SetSizePosInSetControls)
 
 ui::TEST (AXTreeTest, SetSizePosInSetLeafPopUpButton)
 
 ui::TEST (AXTreeTest, OnNodeWillBeDeletedHasValidUnignoredParent)
 
 ui::TEST (AXTreeTest, OnNodeHasBeenDeleted)
 
 ui::TEST (AXTreeTest, SingleUpdateDeletesNewlyCreatedChildNode)
 
 ui::TEST (AXTreeTest, SingleUpdateReparentsNodeMultipleTimes)
 
 ui::TEST (AXTreeTest, SingleUpdateIgnoresNewlyCreatedUnignoredChildNode)
 
 ui::TEST (AXTreeTest, SingleUpdateTogglesIgnoredStateAfterCreatingNode)
 
 ui::TEST (AXTreeTest, SingleUpdateTogglesIgnoredStateBeforeDestroyingNode)
 
 ui::TEST (AXTreeTest, TestIsInListMarker)
 

Macro Definition Documentation

◆ EXPECT_OPTIONAL_EQ

#define EXPECT_OPTIONAL_EQ (   expected,
  actual 
)
Value:
EXPECT_TRUE(actual.has_value()); \
if (actual) { \
EXPECT_EQ(expected, actual.value()); \
}
#define EXPECT_TRUE(handle)
Definition: unit_test.h:678

Definition at line 291 of file ax_tree_unittest.cc.

◆ TEST_SELECTION

#define TEST_SELECTION (   tree_update,
  tree,
  input,
  expected 
)
Value:
{ \
tree_update.has_tree_data = true; \
tree_update.tree_data.sel_anchor_object_id = input.anchor_id; \
tree_update.tree_data.sel_anchor_offset = input.anchor_offset; \
tree_update.tree_data.sel_focus_object_id = input.focus_id; \
tree_update.tree_data.sel_focus_offset = input.focus_offset; \
EXPECT_TRUE(tree->Unserialize(tree_update)); \
AXTree::Selection actual = tree->GetUnignoredSelection(); \
EXPECT_EQ(expected.anchor_id, actual.anchor_object_id); \
EXPECT_EQ(expected.anchor_offset, actual.anchor_offset); \
EXPECT_EQ(expected.focus_id, actual.focus_object_id); \
EXPECT_EQ(expected.focus_offset, actual.focus_offset); \
}

Definition at line 23 of file ax_tree_unittest.cc.