From ac1f1c42c7728a78a776b5290e3442823debd659 Mon Sep 17 00:00:00 2001 From: Robin Burchell Date: Sun, 17 Aug 2014 22:01:21 +0200 Subject: tst_qlistview: Convert some qWaits into QTRY_* usage. This takes the total runtime of tst_qlistview for me from ~47 seconds to ~10 seconds. Change-Id: Ie6fe95fe0852c2de37e99c2ad02230de78e0995e Reviewed-by: Gunnar Sletta --- tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'tests') diff --git a/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp b/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp index 78a3ad021b..b36b5aef8a 100644 --- a/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp +++ b/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp @@ -2235,8 +2235,7 @@ void tst_QListView::taskQTBUG_21804_hiddenItemsAndScrollingWithKeys() QTest::keyClick(&lv, Qt::Key_Down); else QTest::keyClick(&lv, Qt::Key_Right); - QTest::qWait(100); - QVERIFY(lv.rect().contains(lv.visualRect(lv.currentIndex()))); + QTRY_VERIFY(lv.rect().contains(lv.visualRect(lv.currentIndex()))); } // scroll backward @@ -2245,8 +2244,7 @@ void tst_QListView::taskQTBUG_21804_hiddenItemsAndScrollingWithKeys() QTest::keyClick(&lv, Qt::Key_Up); else QTest::keyClick(&lv, Qt::Key_Left); - QTest::qWait(100); - QVERIFY(lv.rect().contains(lv.visualRect(lv.currentIndex()))); + QTRY_VERIFY(lv.rect().contains(lv.visualRect(lv.currentIndex()))); } // scroll forward only half way @@ -2255,8 +2253,7 @@ void tst_QListView::taskQTBUG_21804_hiddenItemsAndScrollingWithKeys() QTest::keyClick(&lv, Qt::Key_Down); else QTest::keyClick(&lv, Qt::Key_Right); - QTest::qWait(100); - QVERIFY(lv.rect().contains(lv.visualRect(lv.currentIndex()))); + QTRY_VERIFY(lv.rect().contains(lv.visualRect(lv.currentIndex()))); } // scroll backward again @@ -2265,8 +2262,7 @@ void tst_QListView::taskQTBUG_21804_hiddenItemsAndScrollingWithKeys() QTest::keyClick(&lv, Qt::Key_Up); else QTest::keyClick(&lv, Qt::Key_Left); - QTest::qWait(100); - QVERIFY(lv.rect().contains(lv.visualRect(lv.currentIndex()))); + QTRY_VERIFY(lv.rect().contains(lv.visualRect(lv.currentIndex()))); } } -- cgit v1.2.3