From cceddaf3da54bff3e746dd5ed67cc5462fb85cf2 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 26 Feb 2016 20:28:05 +0100 Subject: [PATCH] dd a hack to make wxBitmapComboBox Editable() unit test pass Sleep for a little while before sending text to this control as the test often (although not always) fails without it under wxGTK. --- tests/controls/textentrytest.cpp | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/tests/controls/textentrytest.cpp b/tests/controls/textentrytest.cpp index 19b41ff406..b5c4fddfe9 100644 --- a/tests/controls/textentrytest.cpp +++ b/tests/controls/textentrytest.cpp @@ -211,21 +211,6 @@ private: void TextEntryTestCase::Editable() { - -#ifdef __WXGTK__ - // FIXME: For some reason this test regularly (although not always) fails - // in wxGTK build bot builds when testing wxBitmapComboBox, but I - // can't reproduce the failure locally. For now, disable this check - // to let the entire test suite pass in automatic tests instead of - // failing sporadically. - if ( wxStrcmp(GetTestWindow()->GetClassInfo()->GetClassName(), - "wxBitmapComboBox") == 0 && - IsAutomaticTest() ) - { - return; - } -#endif // __WGTK__ - wxTextEntry * const entry = GetTestEntry(); wxWindow * const window = GetTestWindow(); @@ -234,6 +219,13 @@ void TextEntryTestCase::Editable() window->SetFocus(); wxYield(); +#ifdef __WXGTK__ + // For some reason, wxBitmapComboBox doesn't appear on the screen without + // this (due to wxTLW size hacks perhaps?). It would be nice to avoid doing + // this, but without this hack the test often (although not always) fails. + wxMilliSleep(50); +#endif // __WGTK__ + // Check that we get the expected number of events. wxUIActionSimulator sim; sim.Text("abcdef");