Repository navigation
feat(nsgotest): run a frame stamped with a given time - #2379
Conversation
houko
left a comment
There was a problem hiding this comment.
Verified against latest main. App.FrameAt drives only the pending headless frame, preserves the clock, skips target runs, and the regression covers timestamps ahead of and behind the clock plus no pending frame. Documentation and changelog are updated, and all repository checks are green. Approving.
houko
left a comment
There was a problem hiding this comment.
Reviewed against latest origin/main and issue #2256.
The new App.FrameAt method consumes the same frameWanted bookkeeping as the existing headless frame loop, dispatches Scope.RunFrameAt with the requested timestamp, leaves the manual clock unchanged, and settles follow-up graph work. It correctly skips target-backed runs, uses the clock's current time for a zero timestamp, and does nothing when no frame is pending. The regression test covers timestamps ahead of and before the clock plus the no-pending-frame case. English and Chinese testing docs, the animation architecture note, and the changelog are updated.
All reported required checks are green, including formatting, build and vet, the full test suite, platform tests, and CodeQL. Approving.
a2001f1 to
fe4f2ab
Compare
A display may stamp a frame with when it will show, a frame ahead of the clock or before it, and only smuggling a scope out of the view could test it. Add App.FrameAt, which runs the waiting frame with that stamp without moving the clock, and settles. Co-Authored-By: Claude Opus 5.5 <[email protected]>
fe4f2ab to
5bcc3a8
Compare
Summary
A display may stamp a frame with when it will show — a frame ahead of
Scope.Now, as macOS and iOS do, or before it, as an Android vsync or a web frame that began before a resume can. A test could only reach that by capturing the view's scope and postingcx.RunFrameAt(at), which goes aroundApp's frame bookkeeping and is not documented.Add
nsgotest.App.FrameAt(at): it runs the display frame the app waits for, stampedat, without moving the clock, and settles. A zeroatstamps the clock's now, and no waiting frame runs nothing. Under-targetit skips the test, as other headless-only steps do.Fixes #2256.
Targets
core,base,ui,tsx, thensgotool)Screenshots
None; nothing visible changes.
Verification
New test
TestFrameAtStampsTheWaitingFramecovers a frame stamped a frame ahead of the clock, one stamped before it, and a call with no frame waiting; each checks the stamp the callback hears and that the clock did not move.go tool nsgo test ./nsgotest -count=1: 242 passed, 1 skipped.go run ./tools/changelog checkpasses with the new fragment.docs/public/en/testing.md,docs/public/zh/testing.mdand the headless paragraph ofdocs/architecture/animation.mdname it.go tool nsgo checkgo tool nsgo testgo tool nsgo test -target <target>on the targets aboveChecklist
changelog.d/fragment, not inCHANGELOG.md.🤖 Generated with Claude Code