Move getting the unit test event count from wxTestableFrame to the EventCounter class. This reduces the need to have wxTestableFrame pointers all over the unit testing code and should reduce bugs caused by counting the wrong events.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70871 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Steve Lamerton
2012-03-11 14:32:24 +00:00
parent 6c6b938377
commit 744d91d41f
26 changed files with 294 additions and 466 deletions

View File

@@ -120,10 +120,7 @@ void HtmlWindowTestCase::Title()
#if wxUSE_UIACTIONSIMULATOR
void HtmlWindowTestCase::CellClick()
{
wxTestableFrame* frame = wxStaticCast(wxTheApp->GetTopWindow(),
wxTestableFrame);
EventCounter count1(m_win, wxEVT_COMMAND_HTML_CELL_CLICKED);
EventCounter clicked(m_win, wxEVT_COMMAND_HTML_CELL_CLICKED);
wxUIActionSimulator sim;
@@ -137,15 +134,12 @@ void HtmlWindowTestCase::CellClick()
sim.MouseClick();
wxYield();
CPPUNIT_ASSERT_EQUAL(1, frame->GetEventCount());
CPPUNIT_ASSERT_EQUAL(1, clicked.GetCount());
}
void HtmlWindowTestCase::LinkClick()
{
wxTestableFrame* frame = wxStaticCast(wxTheApp->GetTopWindow(),
wxTestableFrame);
EventCounter count1(m_win, wxEVT_COMMAND_HTML_LINK_CLICKED);
EventCounter clicked(m_win, wxEVT_COMMAND_HTML_LINK_CLICKED);
wxUIActionSimulator sim;
@@ -159,7 +153,7 @@ void HtmlWindowTestCase::LinkClick()
sim.MouseClick();
wxYield();
CPPUNIT_ASSERT_EQUAL(1, frame->GetEventCount());
CPPUNIT_ASSERT_EQUAL(1, clicked.GetCount());
}
#endif // wxUSE_UIACTIONSIMULATOR