Wait until grid is fully shown in the unit test

Without this, the mouse clicks sometimes are received by the parent
frame and not the grid itself.
This commit is contained in:
Vadim Zeitlin
2019-10-17 22:04:20 +02:00
parent 94bdb7402d
commit 57d2be63fc

View File

@@ -27,6 +27,8 @@
#include "wx/stopwatch.h"
#endif // __WXGTK__
#include "waitforpaint.h"
class GridTestCase : public CppUnit::TestCase
{
public:
@@ -132,8 +134,15 @@ void GridTestCase::setUp()
if( ms_nativelabels )
m_grid->SetUseNativeColLabels();
WaitForPaint waitForPaint(m_grid->GetGridWindow());
m_grid->Refresh();
m_grid->Update();
if ( !waitForPaint.YieldUntilPainted() )
{
WARN("Grid not repainted until timeout expiration");
}
}
void GridTestCase::tearDown()