]> git.saurik.com Git - wxWidgets.git/blobdiff - tests/controls/buttontest.cpp
Revert "Temporarily disable the failing wxRichTextCtrl case."
[wxWidgets.git] / tests / controls / buttontest.cpp
index 9d6e9a4e29990733f081d36dfc8ae87df13aa09b..37502ea4fe6ddba0ad638c212b8e56e7df322ef5 100644 (file)
@@ -61,7 +61,7 @@ private:
 // register in the unnamed registry so that these tests are run by default
 CPPUNIT_TEST_SUITE_REGISTRATION( ButtonTestCase );
 
-// also include in it's own registry so that these tests can be run alone
+// also include in its own registry so that these tests can be run alone
 CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( ButtonTestCase, "ButtonTestCase" );
 
 void ButtonTestCase::setUp()
@@ -80,12 +80,9 @@ void ButtonTestCase::tearDown()
 
 void ButtonTestCase::Click()
 {
-    wxTestableFrame* frame = wxStaticCast(wxTheApp->GetTopWindow(),
-                                          wxTestableFrame);
-
     //We use the internal class EventCounter which handles connecting and
     //disconnecting the control to the wxTestableFrame
-    EventCounter count(m_button, wxEVT_COMMAND_BUTTON_CLICKED);
+    EventCounter clicked(m_button, wxEVT_COMMAND_BUTTON_CLICKED);
 
     wxUIActionSimulator sim;
 
@@ -97,15 +94,12 @@ void ButtonTestCase::Click()
     sim.MouseClick();
     wxYield();
 
-    CPPUNIT_ASSERT_EQUAL( 1, frame->GetEventCount() );
+    CPPUNIT_ASSERT_EQUAL( 1, clicked.GetCount() );
 }
 
 void ButtonTestCase::Disabled()
 {
-    wxTestableFrame* frame = wxStaticCast(wxTheApp->GetTopWindow(),
-                                          wxTestableFrame);
-
-    EventCounter count(m_button, wxEVT_COMMAND_BUTTON_CLICKED);
+    EventCounter clicked(m_button, wxEVT_COMMAND_BUTTON_CLICKED);
 
     wxUIActionSimulator sim;
 
@@ -118,7 +112,7 @@ void ButtonTestCase::Disabled()
     sim.MouseClick();
     wxYield();
 
-    CPPUNIT_ASSERT_EQUAL( 0, frame->GetEventCount() );
+    CPPUNIT_ASSERT_EQUAL( 0, clicked.GetCount() );
 }
 
 #endif // wxUSE_UIACTIONSIMULATOR