mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-10-21 15:02:21 +02:00
The AutoMix tests slept about 17 s of wall time waiting for fades, tempo recovery and "nothing happens" windows, and the haptics tests 1.15 s. fake_async is not a direct dependency, so the analyzer rejects importing it. Haptics tests run as testWidgets on the binding's FakeAsync clock, which also drives the PlaybackState position extrapolation. The AutoMix player shares process-wide runtime state (the listening recorder and personalization write chains), so a FakeAsync zone that stops after one test would strand later tests. test/support/virtual_time adds a zone with virtual timers and real microtasks instead: setUp builds the player in that zone, and fakeTimeTest runs a body with its timers fired in due order, skipping idle time. Pending timers continue on real time afterwards. AutoMix reads its fade and readiness clocks through autoMixStopwatch, which defaults to Stopwatch.new; tests point it, and the native fake's deck clocks, at the virtual clock. Test bodies and assertions are unchanged.