You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit ea437cb
Browse filesBrowse the repository at this point in the historyBrowse files
fix(ios): stop a tap's post-gesture lookup from recording an XCTest failure (#3060)
A tap resolves its element through a query and keeps a handle bound to that
query, so reading the handle afterwards re-runs the query. A Flutter password
field reports `TextField` through the legacy accessibility attributes and
`Other` through the modern ones once it takes focus, so it stops answering the
query that found it, XCTest answers `No matches found for Element at index 1
from input {(TextField)}` and RECORDS a failure, and the dispatch path converts
that into XCTEST_RECORDED_FAILURE plus an invalidated target. The runner
restarts for a tap the dispatch had already landed and the field had visibly
taken focus, which is the 7-14 s per tap the report measures. ADR 0005 already
keeps a tap's outcome independent of this bookkeeping.
Two reads depended on it. `rememberTextEntryTap` re-derived `isTextEntryElement`
after the gesture even though both tap routes had already classified the element
before dispatching it — the selector route from its own `isTextEntryElement`, the
coordinate route from a probe that enumerates only text-entry element types — so
the re-check could only ever agree or die. Ask it of nothing: the parameter is
now the caller's classification, and the tap books its witness from that.
The post-tap readiness wait read `element.elementType` and then `element.frame`,
which are the two reads that record. Read the same facts through `snapshot()`,
which answers the query the same way but through the throwing channel and records
nothing — the remedy the report asked for, and already how `probeTextEntryInput`
and `withElement` reach an element. Measured on a handle whose element had left
its query: `snapshot()` records nothing and throws 10008, where `.elementType`
and `.frame` each record one failure and raise. The frame is still read after the
wait, so the focus repeat keeps aiming at where the field is rather than where the
tap started: focusing a field moves the layout, and a pre-gesture point can name a
different field or none.
Both new cases are measured red on the base with the report's own signature,
recorded at `isTextEntryElement` and at the readiness reads, and green here. The
fixture's field leaves the accessibility tree on focus, the consequence both
attribute channels produce, and an app-side delegate witness lets the test prove
the gesture took focus when the tree no longer can.
0 commit comments