AccessibilityProbe
Reads a rendered tree the way an accessibility service does: as nodes, not as Views.
A service never sees a ComponentHost. It sees a tree of AccessibilityNodeInfo, some nodes backed by a View and some virtual, and it acts on them by id. A test that reaches for a ComponentHost is asserting on where the node happens to come from today rather than on what a service observes, so it has to be rewritten the moment components stop mounting a View of their own. Locate targets through this instead, and the same test covers either implementation.
Nothing is cached: every lookup re-walks the tree and re-reads each node, so a probe held across a re-render reports the new state.
The tree must be attached to a real window — see LithoTestRule.attachToRealWindow.
Functions
Every node a service could reach from the root, in the order of the node tree the platform hands a service: a View's children as View.addChildrenForAccessibility lists them, with unimportant Views flattened out and siblings sorted by position on screen, and a virtual node's children in id order. That is not quite reading order: a service also applies the traversalBefore/traversalAfter hints Style.focusOrder sets, and this does not.