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:
Daniel Martí
2019-11-02 11:45:57 +00:00
committed by Elias Naur
parent 2a9361db65
commit 97d13922dd
3 changed files with 60 additions and 11 deletions
+3 -2
View File
@@ -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)
}