Repository navigation
Commit ad38e6d
authored
test(interaction-harness): a hold the page arms itself takes a short animation on its first frame (#9230)
test(interaction-harness): a hold the page arms itself takes a short animation on its first frame
`holdAnimations` reaches the page after a round trip, and on a loaded
runner a short animation can end before it arrives: component proofs
that hold a 200 ms press release miss it on a two-core Chromium pin, and
main's own "a second hold" self-test fails that way in WebKit at 16
workers on 3 CPUs and on a two-core pin with CPU-bound processes on the
same cores.
`await armHold(page, scope)` arms the page before the action; it holds
every running animation under the scope as soon as one of them runs (or
`count` of them, for parts that start apart; with `newOnly`, only
animations that start after the arm, so a turn that starts mid-motion is
held while the motion goes on), and `held()` after the action returns
what it held. It holds through the same in-page body as
`holdAnimations`, installed in the evaluate that installs the curve end
so a hold costs no extra round trip, and into the same held set, so
`seekAnimations`, `sampleCurve` and `releaseAnimations` read it
unchanged, and a later hold adds to it. It looks on every frame callback
and every 4 ms between them: on a cold page WebKit can deliver no frame
callback for about 70 ms while it first composites a newly animated
layer, while its timers run and its animations advance. The busy-window
control never counts (an unscoped hold still pauses it, as it takes
every running animation), and `held()` rejects when nothing under the
scope ran before the timeout. `animationStoryboard` films what an armed
hold took (`held`) instead of holding after the action. The holding,
curve-sampling and storyboard self-tests that hold a short animation an
action starts arm their holds. Three that hold after a wait or a watch,
or hold two runners started 100 ms apart (which an armed hold would take
one at a time), run their animations for 6 to 10 s instead of 0.6 to 1 s
at the same speed. The two-runner test also makes its second runner once
the first has started, so a loaded engine cannot give both one first
frame, and seeks 150 ms past the second start, however late that came.
The staggered-starts filmstrip sets its second start 83 ms after the
first on the document timeline rather than with a timer, and the page
holds all three runs once the second move runs (`count: 3`). Three new
self-tests cover the armed hold: a 120 ms run held on its first frames,
a turn held mid-motion with `newOnly` (both read only after the run
would have ended), and a rejection when nothing starts.
Red first: component proofs that hold a 200 ms press release fail on a
two-core Chromium pin when they hold after the lift and pass with armed
holds; on main, a second hold fails in WebKit at 16 workers on 3 CPUs,
and the holding describe in Chromium under the load above; with the
armed holds they pass there.1 parent a1b7c6b commit ad38e6d
4 files changed
Lines changed: 500 additions & 139 deletions
File tree
- internal/interaction-harness
- src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | | - | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
80 | 88 | | |
81 | 89 | | |
82 | 90 | | |
| |||
0 commit comments