Fix wxComboBox unit test under wxGTK after recent changes

wxEVT_COMBOBOX_CLOSEUP is sent during idle time after the changes of
a216806c99, so add wxYield() to make sure that
the unit test gets it.

See #17223.
This commit is contained in:
Vadim Zeitlin
2016-02-27 02:41:11 +01:00
parent 6c2e702357
commit e29bfda8d8

View File

@@ -145,10 +145,16 @@ void ComboBoxTestCase::PopDismiss()
EventCounter close(m_combo, wxEVT_COMBOBOX_CLOSEUP);
m_combo->Popup();
CPPUNIT_ASSERT_EQUAL(1, drop.GetCount());
m_combo->Dismiss();
CPPUNIT_ASSERT_EQUAL(1, drop.GetCount());
#if defined(__WXGTK__) && !defined(__WXGTK3__)
// Under wxGTK2, the event is sent only during idle time and not
// immediately, so we need this yield to get it.
wxYield();
CPPUNIT_ASSERT_EQUAL(1, close.GetCount());
#endif // wxGTK2
#endif
}