mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-07 18:35:34 +00:00
cmd/gogio: remove sleeps in x11 e2e test
We can instead synchronize with the gio app via stdout. We need three states, since we need to first invalidate a frame and then print when the next frame is drawn. This is not happening on the JS test yet, because stdout printing crashes in that case. See the comment. This change should make the X11 test a bit faster on fast machines, while making it more stable in small or headless machines like CI. Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
This commit is contained in:
@@ -21,7 +21,7 @@ type TestDriver interface {
|
||||
// white.
|
||||
//
|
||||
// When the function returns, the gio app must be ready to use on the
|
||||
// platform.
|
||||
// platform, with its initial frame fully drawn.
|
||||
//
|
||||
// The returned cleanup funcs must be run in reverse order, to mimic
|
||||
// deferred funcs.
|
||||
@@ -32,7 +32,8 @@ type TestDriver interface {
|
||||
Screenshot() image.Image
|
||||
|
||||
// Click performs a pointer click at the specified coordinates,
|
||||
// including both press and release.
|
||||
// including both press and release. It returns when the next frame is
|
||||
// fully drawn.
|
||||
Click(x, y int)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user