Files
Michał Pierzchała b0f9c050ce test: make hard-coded caps overridable behind seams (#1781 B5) (#1858)
* test: make hard-coded caps overridable behind seams (#1781 B5)

HarmonyOS snapshot gains a maxNodes seam (mirroring the Android helper
and Linux AT-SPI capture options) so the node cap's truncation signal is
exercised below the 5,000 default; the durable descriptor JSON node cap
gets its boundary test alongside the existing depth one.

* test: cover both durable-JSON node-cap guards (#1781 B5)

* fix(harmonyos): keep snapshot analysis counting past the emitted-node cap

The walk returned as soon as the cap filled, so an omitted node's
descendants reached neither rawNodeCount nor maxDepth and analysis
under-reported exactly the oversized trees the cap exists for. Emission
is now capped while accounting continues, matching the whole-tree claim
the Android helper's analysis makes.

Also pins the durable descriptor JSON node cap at its exact boundary:
4,096 nodes accepted, 4,097 rejected, through both the object-owned and
array-owned counting sites.

* refactor(harmonyos): own the snapshot traversal policy in a pure function

B5 asked for caps to be overridable so tests can reach them; for this
cap the better answer is to extract the policy rather than widen the
production interface. collectArkUiNodes takes every bound explicitly, so
the emission limit and the accounting-continues-below-it rule are tested
at their owning interface, and snapshotHarmony keeps its SnapshotOptions
shape with no option no caller sets.
2026-08-20 10:37:20 +02:00
..