From e29bfda8d81babc3263b14a48349a798d1ba7731 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 27 Feb 2016 02:41:11 +0100 Subject: [PATCH] Fix wxComboBox unit test under wxGTK after recent changes wxEVT_COMBOBOX_CLOSEUP is sent during idle time after the changes of a216806c996ab6e42f73a821857542774a9c1f79, so add wxYield() to make sure that the unit test gets it. See #17223. --- tests/controls/comboboxtest.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/controls/comboboxtest.cpp b/tests/controls/comboboxtest.cpp index 1fe0d004e0..705f406318 100644 --- a/tests/controls/comboboxtest.cpp +++ b/tests/controls/comboboxtest.cpp @@ -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 }