Skip to content

Commit

Permalink
Menu item safety for Ubuntu tests too
Browse files Browse the repository at this point in the history
  • Loading branch information
andydotxyz committed Jan 10, 2025
1 parent df498a6 commit 49cbf18
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions internal/driver/glfw/canvas_other_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ func TestGlCanvas_FocusHandlingWhenActivatingOrDeactivatingTheMenu(t *testing.T)
assert.Equal(t, ce2, c.Focused())
assert.True(t, ce2.focused)

m.Items[0].(*menuBarItem).Tapped(&fyne.PointEvent{})
runOnMain(func() {
m.Items[0].(*menuBarItem).Tapped(&fyne.PointEvent{})
})
assert.True(t, m.IsActive())
ctxt := "activating the menu changes focus handler and focuses the menu bar item but does not remove focus from content"
assert.True(t, ce2.focused, ctxt)
Expand All @@ -46,7 +48,9 @@ func TestGlCanvas_FocusHandlingWhenActivatingOrDeactivatingTheMenu(t *testing.T)
assert.True(t, ce2.focused, ctxt)
assert.Equal(t, m.Items[1], c.Focused(), ctxt)

m.Items[0].(*menuBarItem).Tapped(&fyne.PointEvent{})
runOnMain(func() {
m.Items[0].(*menuBarItem).Tapped(&fyne.PointEvent{})
})
assert.False(t, m.IsActive())
ctxt = "deactivating the menu restores focus handler from content"
assert.True(t, ce2.focused, ctxt)
Expand Down

0 comments on commit 49cbf18

Please sign in to comment.