Skip to content

test: space every Playwright tap past Chromium's double-tap window - #5839

Merged
max-sixty merged 3 commits into
mainfrom
tap-route
Nov 12, 2026
Merged

max-sixty merged 3 commits into
mainfrom
tap-route

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

Every tap the suite sends through Playwright now waits until half a second has passed since the page's previous tap, so Chromium never counts it as the next press in a run. Chromium counts a touch tap within about 25 px and 400 ms of the previous one as a double tap (click detail 2 and a dblclick), and the floating panel presses nothing for such a press on a control it drew since (runOfClicks). A test that tapped faster than a person therefore passed only on a slow host. #5806 spaced press_visible's taps, and about 30 raw locator.tap() calls stayed unspaced. Instead of routing them through a helper guarded by a source check, fresh_taps (tests/render_harness.py) wraps Playwright's Locator.tap and Touchscreen.tap, the suite's only tap routes. No call site changes, and press_visible loses its own copy.

On the 60 tests/browser tests that tap, Chromium counted 26 touch runs on main and 2 with this change, both from finger holds sent as raw CDP events. The waits add 64 s of sleep, which uses no CPU, across those tests. The worst is 11 s in the playground focus test, spread over its 22 subtests. Waiting only when a tap's target box lay near the previous one cut that to 33 s. A review then reproduced two double taps that passed that check, from a target that moves after its tap and from one that slides in, because Playwright doesn't report where a locator's tap lands. So the wait ignores distance.

Spaced taps exposed a shift_watch.js gap that back-to-back taps had hidden: a control that a tap shows under the finger takes :active and lets go on Chromium's timer, and the watch didn't notice. The watch now also checks the element at the release point, and test_a_tap_s_press_letting_go_is_heard gains that case, which fails on the old watch.

Requested by max-sixty after #5806. Tests: the 60 tap tests in tests/browser and the tapping tests in tests/journeys, the shift-watch press, tap and verdict tests, and test_suite_source. Two failures are inherited and also fail with spacing off: test_a_root_summary_keeps_thread_actions_outside_its_fold[1400-True-10] and test_a_finger_reaches_the_page_commands_its_keys_reach.

This was written by Claude Code on behalf of max-sixty

Every tap the suite sends through Playwright's `Locator.tap` or
`Touchscreen.tap` now waits until half a second has passed since the
page's previous tap (`render_harness.fresh_taps`, installed by the
session's Playwright fixture). Chromium counts a touch tap within about
25 px and 400 ms of the previous one as the next press in a run (click
`detail` 2 and a `dblclick`), and the floating panel presses nothing for
such a press on a control it drew since (`runOfClicks`), so a test that
tapped faster than a person passed only on a slow host. #5806 spaced
`press_visible`'s taps; about 30 raw `locator.tap()` calls stayed
unspaced. Wrapping Playwright's two tap routes covers every call site
with none changed, needs no source check against raw taps, and removes
`press_visible`'s own copy.

On the 60 tests/browser tests that tap, Chromium counted 26 touch runs on
main and 2 with this change, both from finger holds sent as raw CDP
events. The waits add 64 s of sleep across those tests. Waiting only
when the target's box lay near the previous tap's cut that to 33 s, but
Playwright doesn't report where a locator's tap lands, and two double
taps passed that check: a target that moved after its tap, and one that
slid in. So the wait ignores distance.

Spaced taps exposed a shift_watch.js gap that back-to-back taps hid: a
control a tap shows under the finger takes `:active` and lets go on
Chromium's timer, unheard. The watch now also asks the element at the
release point; test_a_tap_s_press_letting_go_is_heard gains that case,
which fails on the old watch.
@max-sixty
max-sixty merged commit 4b0bdd7 into main Nov 12, 2026
5 checks passed
@max-sixty
max-sixty deleted the tap-route branch November 12, 2026 00:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants