Make wxUIActionSimulator works more reliably on GTK/X11
Add wxXSync class which adds delays between the synthesized events sufficient for them to be processed by the higher layers (X, GTK). This makes it possible to run the UI tests by default with wxGTK. Closes https://github.com/wxWidgets/wxWidgets/pull/1845
This commit is contained in:
committed by
Vadim Zeitlin
parent
fb5c13ed00
commit
59ad9f46e6
@@ -578,17 +578,6 @@ private:
|
||||
|
||||
void MenuTestCase::Events()
|
||||
{
|
||||
#ifdef __WXGTK__
|
||||
// FIXME: For some reason, we sporadically fail to get the event in
|
||||
// buildbot slave builds even though the test always passes locally.
|
||||
// There is undoubtedly something wrong here but without being able
|
||||
// to debug it, I have no idea what is it, so let's just disable
|
||||
// this test when running under buildbot to let the entire test
|
||||
// suite pass.
|
||||
if ( IsAutomaticTest() )
|
||||
return;
|
||||
#endif // __WXGTK__
|
||||
|
||||
#if wxUSE_UIACTIONSIMULATOR
|
||||
MenuEventHandler handler(m_frame);
|
||||
|
||||
@@ -597,12 +586,6 @@ void MenuTestCase::Events()
|
||||
m_frame->SetFocus();
|
||||
wxYield();
|
||||
|
||||
#ifdef __WXGTK__
|
||||
// This is another test which fails with wxGTK without this delay because
|
||||
// the frame doesn't appear on screen in time.
|
||||
wxMilliSleep(50);
|
||||
#endif // __WXGTK__
|
||||
|
||||
wxUIActionSimulator sim;
|
||||
sim.KeyDown(WXK_F1);
|
||||
sim.KeyUp(WXK_F1);
|
||||
|
Reference in New Issue
Block a user