test(android): pin that a child vanishing mid-read reads as gone
Merged
TH
2d ago+53+53+01234567890123456789-4-4-0123456789
Summary
Follow-up to #3901, applying the review's non-blocking notes. 2 files changed.
AccessibilityNodeReads.childnow reads throughnullIfGone, a small generic seam that treats a throwing read as a gone node. The JVM suite can reach it, and a newAccessibilityReadBatchTestcase fails if the catch is removed. A non-vanishing failure (IllegalStateException) still propagates.- A doc comment says a null
nodeis a programmer error that the catch would also hide. child.getChildCountand the bounds reads inappendNodeneed no guard. In the framework sources (API 35),getChildCount()returnsmChildNodeIds.size()andgetBoundsInScreen(Rect)copiesmBoundsInScreen. Both are field reads on a sealed node with no interaction-client call. OnlygetChildgoes throughAccessibilityInteractionClient, and #3901 already covers it.
Validation
- Head a09cc7df06:
pnpm check:affected --run --head a09cc7df06passed (exactCommit). The snapshot helper build runsSnapshotHelperTestSuite, which includes the new case. - With the catch changed to a different exception type, the same build fails with
NullPointerException: window closedfrom the new case. - GitHub owns the Android lanes. No device run: the change is a refactor of the already-verified catch.
🤖 Generated with Claude Code