Remove unnecessary hack from ListBaseTestCase under wxGTK
The tests pass without it now, so simplify the test code added in
fedc80eee3
(Improve selection and focus events generation in
wxGenericLisCtrl, 2020-09-06).
Closes https://github.com/wxWidgets/wxWidgets/pull/2249
This commit is contained in:
parent
0728262640
commit
2689040769
@ -175,14 +175,6 @@ void ListBaseTestCase::ChangeMode()
|
|||||||
CPPUNIT_ASSERT_EQUAL( "First", list->GetItemText(0) );
|
CPPUNIT_ASSERT_EQUAL( "First", list->GetItemText(0) );
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __WXGTK__
|
|
||||||
#define wxGTK_TIMED_YIELD(t) \
|
|
||||||
if ( !IsRunningUnderXVFB() ) \
|
|
||||||
for ( wxStopWatch sw; sw.Time() < t; ) wxYield()
|
|
||||||
#else // !__WXGTK__
|
|
||||||
#define wxGTK_TIMED_YIELD(t)
|
|
||||||
#endif // __WXGTK__
|
|
||||||
|
|
||||||
void ListBaseTestCase::MultiSelect()
|
void ListBaseTestCase::MultiSelect()
|
||||||
{
|
{
|
||||||
#if wxUSE_UIACTIONSIMULATOR
|
#if wxUSE_UIACTIONSIMULATOR
|
||||||
@ -219,8 +211,6 @@ void ListBaseTestCase::MultiSelect()
|
|||||||
sim.MouseClick(); // select the anchor
|
sim.MouseClick(); // select the anchor
|
||||||
wxYield();
|
wxYield();
|
||||||
|
|
||||||
wxGTK_TIMED_YIELD(50);
|
|
||||||
|
|
||||||
list->GetItemRect(5, pos);
|
list->GetItemRect(5, pos);
|
||||||
point = list->ClientToScreen(pos.GetPosition()) + wxPoint(10, 10);
|
point = list->ClientToScreen(pos.GetPosition()) + wxPoint(10, 10);
|
||||||
|
|
||||||
@ -232,8 +222,6 @@ void ListBaseTestCase::MultiSelect()
|
|||||||
sim.KeyUp(WXK_SHIFT);
|
sim.KeyUp(WXK_SHIFT);
|
||||||
wxYield();
|
wxYield();
|
||||||
|
|
||||||
wxGTK_TIMED_YIELD(10);
|
|
||||||
|
|
||||||
// when the first item was selected the focus changes to it, but not
|
// when the first item was selected the focus changes to it, but not
|
||||||
// on subsequent clicks
|
// on subsequent clicks
|
||||||
CPPUNIT_ASSERT_EQUAL(4, list->GetSelectedItemCount()); // item 2 to 5 (inclusive) are selected
|
CPPUNIT_ASSERT_EQUAL(4, list->GetSelectedItemCount()); // item 2 to 5 (inclusive) are selected
|
||||||
@ -248,8 +236,6 @@ void ListBaseTestCase::MultiSelect()
|
|||||||
sim.Char(WXK_END, wxMOD_SHIFT); // extend the selection to the last item
|
sim.Char(WXK_END, wxMOD_SHIFT); // extend the selection to the last item
|
||||||
wxYield();
|
wxYield();
|
||||||
|
|
||||||
wxGTK_TIMED_YIELD(10);
|
|
||||||
|
|
||||||
CPPUNIT_ASSERT_EQUAL(8, list->GetSelectedItemCount()); // item 2 to 9 (inclusive) are selected
|
CPPUNIT_ASSERT_EQUAL(8, list->GetSelectedItemCount()); // item 2 to 9 (inclusive) are selected
|
||||||
CPPUNIT_ASSERT_EQUAL(1, focused.GetCount()); // focus is on the last item
|
CPPUNIT_ASSERT_EQUAL(1, focused.GetCount()); // focus is on the last item
|
||||||
CPPUNIT_ASSERT_EQUAL(4, selected.GetCount()); // only newly selected items got the event
|
CPPUNIT_ASSERT_EQUAL(4, selected.GetCount()); // only newly selected items got the event
|
||||||
@ -262,8 +248,6 @@ void ListBaseTestCase::MultiSelect()
|
|||||||
sim.Char(WXK_HOME, wxMOD_SHIFT); // select from anchor to the first item
|
sim.Char(WXK_HOME, wxMOD_SHIFT); // select from anchor to the first item
|
||||||
wxYield();
|
wxYield();
|
||||||
|
|
||||||
wxGTK_TIMED_YIELD(10);
|
|
||||||
|
|
||||||
CPPUNIT_ASSERT_EQUAL(3, list->GetSelectedItemCount()); // item 0 to 2 (inclusive) are selected
|
CPPUNIT_ASSERT_EQUAL(3, list->GetSelectedItemCount()); // item 0 to 2 (inclusive) are selected
|
||||||
CPPUNIT_ASSERT_EQUAL(1, focused.GetCount()); // focus is on item 0
|
CPPUNIT_ASSERT_EQUAL(1, focused.GetCount()); // focus is on item 0
|
||||||
CPPUNIT_ASSERT_EQUAL(2, selected.GetCount()); // events are only generated for item 0 and 1
|
CPPUNIT_ASSERT_EQUAL(2, selected.GetCount()); // events are only generated for item 0 and 1
|
||||||
|
Loading…
Reference in New Issue
Block a user