Skip to content

Commit

Permalink
Fix race in window fullscreen test (#5296)
Browse files Browse the repository at this point in the history
  • Loading branch information
andydotxyz authored Dec 8, 2024
1 parent d1f7564 commit a31d23e
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions internal/driver/glfw/window_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit a31d23e

Please sign in to comment.