Try changing BitmapToggleButtonTestCase to avoid wxMSW failures

This test sporadically fails under AppVeyor, perhaps due to a hard-coded
sleep in it which may somehow misbehave there -- try changing it not to
rely on this sleep.

This has a nice side effect of making the test run faster, too.
This commit is contained in:
Vadim Zeitlin 2023-10-01 21:14:00 +02:00
parent 9b9ec141fb
commit 3f2b7f6bdb

View file

@ -74,8 +74,10 @@ void BitmapToggleButtonTestCase::Click()
wxUIActionSimulator sim;
const wxPoint pos = m_button->GetScreenPosition();
//We move in slightly to account for window decorations
sim.MouseMove(m_button->GetScreenPosition() + wxPoint(10, 10));
sim.MouseMove(pos + wxPoint(10, 10));
wxYield();
sim.MouseClick();
@ -86,9 +88,10 @@ void BitmapToggleButtonTestCase::Click()
clicked.Clear();
#ifdef __WXMSW__
wxMilliSleep(1000);
#endif
// Change the mouse position to prevent the second click from being
// recognized as double click.
sim.MouseMove(pos + wxPoint(20, 20));
wxYield();
sim.MouseClick();
wxYield();