Test-only seam (BEH-12): overrides how the InternetConnection is
constructed in _initializeNetworkChecking so the leak/idempotency test
(BEH-3) can inject a fake that records dispose()/subscription lifecycle.
When null, the real InternetConnection.createInstance is used.
Test-only seam (BEH-12, additive): inject the single-probe function so
tests can drive the startup retry loop / confirmation without a real
checker. A leading-underscore field is library-private and unsettable from
an external test library; @visibleForTesting on a private member raises
invalid_visibility_annotation, so a public setter is required (mirrors
the existing handleVersionUpdateForTest / emitStartupStatusForTest seams).
Test-only seam (BEH-12): run the budget-bounded startup retry loop in
isolation. Call computeEffectiveNetworkConfigForTest first so
_effectiveProbeTimeoutMs is populated as in production.
Test-only seam: emit a startup-path status through the sticky-updateRequired
guarded setter (Issues 88/91), modelling the cold-start sequence where the
version microtask sets updateRequired before a startup downgrade runs.
Test-only seam (BEH-12, additive): drive the shared startup self-heal
helper (_enterStartupNetworkErrorSelfHeal) directly so the exception-path
self-heal (NET-021) — otherwise only reachable via a genuine init exception
inside _initializeNetworkChecking — can be exercised in isolation.
Test-only seam (BEH-12, additive): drive the guarded resume re-probe
(_handleAppResumedNetworkReprobe) directly. The production wiring in
_initializeLifecycleService runs only after getInitialData (Firebase-
coupled); this seam exercises the hook's guards (loading gate, kill-switch,
epoch/close fencing, resume-recovery resync) in isolation.
Test-only seam (BEH-12, additive): drive the confirm-before-flip handler
directly (mirrors handleVersionUpdateForTest). Returns the handler's
future so the confirmation pass can be awaited to completion.
Called whenever a change occurs with the given change.
A change occurs when a new state is emitted.
onChange is called before the state of the cubit is updated.
onChange is a great spot to add logging/analytics for a specific cubit.