diff --git a/tests/controls/dataviewctrltest.cpp b/tests/controls/dataviewctrltest.cpp index 53f8e0ea18..a22a5aad11 100644 --- a/tests/controls/dataviewctrltest.cpp +++ b/tests/controls/dataviewctrltest.cpp @@ -17,6 +17,8 @@ #include "wx/app.h" #include "wx/dataview.h" +#include "wx/uiaction.h" + #ifdef __WXGTK__ #include "wx/stopwatch.h" #endif // __WXGTK__ @@ -412,4 +414,26 @@ TEST_CASE_METHOD(MultiColumnsDataViewCtrlTestCase, CHECK( m_lastColumn->GetWidth() >= lastColumnMinWidth ); } +#if wxUSE_UIACTIONSIMULATOR + +TEST_CASE_METHOD(SingleSelectDataViewCtrlTestCase, + "wxDVC::KeyEvents", + "[wxDataViewCtrl][event]") +{ + if ( !EnableUITests() ) + return; + + EventCounter keyEvents(m_dvc->GetMainWindow(), wxEVT_KEY_DOWN); + + m_dvc->SetFocus(); + + wxUIActionSimulator sim; + sim.Char(WXK_DOWN); + wxYield(); + + CHECK( keyEvents.GetCount() == 1 ); +} + +#endif // wxUSE_UIACTIONSIMULATOR + #endif //wxUSE_DATAVIEWCTRL