Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Use real mouse events with Chromium in the shell #21419

Merged
merged 4 commits into from
Dec 12, 2024

Conversation

martinpitt
Copy link
Member

@martinpitt martinpitt commented Dec 10, 2024

BiDi mouse events work fine on the top-level document (i.e. not in frames). So let's use them to test the shell.

@martinpitt martinpitt added the no-test For doc/workflow changes, or experiments which don't need a full CI run, label Dec 10, 2024
@martinpitt martinpitt force-pushed the chromium-shell-real-mouse branch from 18e9f45 to 1ce54dd Compare December 11, 2024 01:14
@martinpitt
Copy link
Member Author

First attempt had many random pixel failures due to the mouse being in a random place and highlighting UI elements. Plus the HostSwitching regression.

With moving the mouse away it looks better -- networking and storage pass, and some other and expensive failures.

@martinpitt martinpitt force-pushed the chromium-shell-real-mouse branch from 1ce54dd to abd3b3f Compare December 11, 2024 02:28
@martinpitt
Copy link
Member Author

Now it's down to host switcher failures, the rest passes. This is due to the animations -- see that utterly compressed menu in the screenshot. We need to wait for that to settle.

@martinpitt martinpitt removed the no-test For doc/workflow changes, or experiments which don't need a full CI run, label Dec 11, 2024
@martinpitt martinpitt force-pushed the chromium-shell-real-mouse branch from abd3b3f to 7ba1bd2 Compare December 11, 2024 03:43
@martinpitt
Copy link
Member Author

martinpitt commented Dec 11, 2024

The precise combination of affected retries here brings back this tracer crash (second instance). While that's unrelated, it makes this PR unbecomingly red, looking.

Handled by cockpit-project/bots#7210

You can't open the session menu to log out while the dialog is still
open. That cheat only works with our Chromium test driver which directly
inserts `MouseEvent`s. We are about to move these to real clicks.
Replace the static sleep with a polling loop.
Opening the host switcher and the host edit view animates (expands) the
hosts menu for about half a second. When doing real clicks instead of
MouseEvent injection, this causes the target elements to move around
underneath the test, resulting in mis-clicks.

Avoid that by waiting for the animation to be over. Unfortunately
`ph_count_animations()` doesn't quite catch it completely in all cases,
so add an extra sleep for robustness. This is similar to what we do in
the pixel tests.
BiDi mouse events work fine on the top-level document (i.e. not in
frames). So let's use them to test the shell.

Generalize the "move mouse position to a harmless place" hack from
commit b5b8c6d, so that we make the pixel snapshots without
focusing a random element on the page.

We can also run `TestPages.testPageStatus` again (reverts commit
529e334).

This just needs one little tweak in TestHostSwitching.testBasic's pixel
test. Our current reference does not expect any dialog item to be
highlighted (when the mouse is over it), so move the mouse out of the
dialog.
@martinpitt martinpitt force-pushed the chromium-shell-real-mouse branch from 7ba1bd2 to c7bdffc Compare December 11, 2024 10:30
@martinpitt
Copy link
Member Author

Looking good! This is a known flake, I sent cockpit-project/bots#7211 to fix it.

This failure is an unrelated known flaky pixel test, #21422

@martinpitt martinpitt marked this pull request as ready for review December 11, 2024 11:33
@martinpitt martinpitt requested review from jelly and mvollmer December 11, 2024 11:33
Copy link
Member

@mvollmer mvollmer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@mvollmer mvollmer merged commit 45e7763 into cockpit-project:main Dec 12, 2024
85 checks passed
@martinpitt martinpitt deleted the chromium-shell-real-mouse branch December 12, 2024 08:03
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