From a31d23e0dfeae6c5a66deea93e06b12aa73855ab Mon Sep 17 00:00:00 2001 From: Andy Williams Date: Sun, 8 Dec 2024 20:01:51 +0000 Subject: [PATCH] Fix race in window fullscreen test (#5296) --- internal/driver/glfw/window_test.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/internal/driver/glfw/window_test.go b/internal/driver/glfw/window_test.go index e7afc3e0df..626739a22e 100644 --- a/internal/driver/glfw/window_test.go +++ b/internal/driver/glfw/window_test.go @@ -1113,8 +1113,9 @@ func TestWindow_Tapped(t *testing.T) { func TestWindow_TappedSecondary(t *testing.T) { w := createWindow("Test").(*window) o := &tappableObject{Rectangle: canvas.NewRectangle(color.White)} + o.SetMinSize(fyne.NewSize(100, 100)) w.SetContent(o) - w.Resize(fyne.NewSize(100, 100)) + waitForMain() w.mousePos = fyne.NewPos(50, 60) w.mouseClicked(w.viewport, glfw.MouseButton2, glfw.Press, 0) @@ -1135,6 +1136,7 @@ func TestWindow_TappedSecondary_OnPrimaryOnlyTarget(t *testing.T) { tapped = true }) w.SetContent(o) + waitForMain() ensureCanvasSize(t, w, fyne.NewSize(53, 44)) w.mousePos = fyne.NewPos(10, 25) @@ -1737,17 +1739,15 @@ func TestWindow_SetContent_Twice(t *testing.T) { } func TestWindow_SetFullScreen(t *testing.T) { - w := createWindow("Full").(*window) + w := d.CreateWindow("Full").(*window) w.SetFullScreen(true) + w.create() + w.create() w.doShow() waitForMain() - - // initial state - no window size set (except darwin?) - if runtime.GOOS != "darwin" { - assert.Zero(t, w.width) - assert.Zero(t, w.height) - } + assert.Zero(t, w.width) + assert.Zero(t, w.height) w.SetFullScreen(false) waitForMain()