Make wxUIActionSimulator works more reliably on GTK/X11
Add wxXSync class which adds delays between the synthesized events sufficient for them to be processed by the higher layers (X, GTK). This makes it possible to run the UI tests by default with wxGTK. Closes https://github.com/wxWidgets/wxWidgets/pull/1845
This commit is contained in:
committed by
Vadim Zeitlin
parent
fb5c13ed00
commit
59ad9f46e6
@@ -128,9 +128,6 @@ void RichTextCtrlTestCase::CharacterEvent()
|
||||
{
|
||||
#if wxUSE_UIACTIONSIMULATOR
|
||||
|
||||
// There seems to be an event sequence problem on GTK+ that causes the events
|
||||
// to be disconnected before they're processed, generating spurious errors.
|
||||
#if !defined(__WXGTK__)
|
||||
EventCounter character(m_rich, wxEVT_RICHTEXT_CHARACTER);
|
||||
EventCounter content(m_rich, wxEVT_RICHTEXT_CONTENT_INSERTED);
|
||||
|
||||
@@ -154,15 +151,12 @@ void RichTextCtrlTestCase::CharacterEvent()
|
||||
CPPUNIT_ASSERT_EQUAL(0, character.GetCount());
|
||||
CPPUNIT_ASSERT_EQUAL(1, content.GetCount());
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
void RichTextCtrlTestCase::DeleteEvent()
|
||||
{
|
||||
#if wxUSE_UIACTIONSIMULATOR
|
||||
// There seems to be an event sequence problem on GTK+ that causes the events
|
||||
// to be disconnected before they're processed, generating spurious errors.
|
||||
#if !defined(__WXGTK__)
|
||||
|
||||
EventCounter deleteevent(m_rich, wxEVT_RICHTEXT_DELETE);
|
||||
EventCounter contentdelete(m_rich, wxEVT_RICHTEXT_CONTENT_DELETED);
|
||||
|
||||
@@ -178,15 +172,12 @@ void RichTextCtrlTestCase::DeleteEvent()
|
||||
//Only one as the delete doesn't delete anthing
|
||||
CPPUNIT_ASSERT_EQUAL(1, contentdelete.GetCount());
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
void RichTextCtrlTestCase::ReturnEvent()
|
||||
{
|
||||
#if wxUSE_UIACTIONSIMULATOR
|
||||
// There seems to be an event sequence problem on GTK+ that causes the events
|
||||
// to be disconnected before they're processed, generating spurious errors.
|
||||
#if !defined(__WXGTK__)
|
||||
|
||||
EventCounter returnevent(m_rich, wxEVT_RICHTEXT_RETURN);
|
||||
|
||||
m_rich->SetFocus();
|
||||
@@ -197,7 +188,6 @@ void RichTextCtrlTestCase::ReturnEvent()
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(1, returnevent.GetCount());
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
void RichTextCtrlTestCase::StyleEvent()
|
||||
@@ -235,8 +225,7 @@ void RichTextCtrlTestCase::BufferResetEvent()
|
||||
void RichTextCtrlTestCase::UrlEvent()
|
||||
{
|
||||
#if wxUSE_UIACTIONSIMULATOR
|
||||
// Mouse up event not being caught on GTK+
|
||||
#if !defined(__WXGTK__)
|
||||
|
||||
EventCounter url(m_rich, wxEVT_TEXT_URL);
|
||||
|
||||
m_rich->BeginURL("http://www.wxwidgets.org");
|
||||
@@ -252,13 +241,11 @@ void RichTextCtrlTestCase::UrlEvent()
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(1, url.GetCount());
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
void RichTextCtrlTestCase::TextEvent()
|
||||
{
|
||||
#if wxUSE_UIACTIONSIMULATOR
|
||||
#if !defined(__WXGTK__)
|
||||
EventCounter updated(m_rich, wxEVT_TEXT);
|
||||
|
||||
m_rich->SetFocus();
|
||||
@@ -270,7 +257,6 @@ void RichTextCtrlTestCase::TextEvent()
|
||||
CPPUNIT_ASSERT_EQUAL("abcdef", m_rich->GetValue());
|
||||
CPPUNIT_ASSERT_EQUAL(6, updated.GetCount());
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
void RichTextCtrlTestCase::CutCopyPaste()
|
||||
@@ -418,7 +404,6 @@ void RichTextCtrlTestCase::Selection()
|
||||
void RichTextCtrlTestCase::Editable()
|
||||
{
|
||||
#if wxUSE_UIACTIONSIMULATOR
|
||||
#if !defined(__WXGTK__)
|
||||
EventCounter updated(m_rich, wxEVT_TEXT);
|
||||
|
||||
m_rich->SetFocus();
|
||||
@@ -438,7 +423,6 @@ void RichTextCtrlTestCase::Editable()
|
||||
CPPUNIT_ASSERT_EQUAL("abcdef", m_rich->GetValue());
|
||||
CPPUNIT_ASSERT_EQUAL(0, updated.GetCount());
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
void RichTextCtrlTestCase::Range()
|
||||
|
Reference in New Issue
Block a user