From: Martin Jones Date: Mon, 21 Nov 2011 05:48:46 +0000 (+1000) Subject: Fix GridView currentIndex test stability X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=b3e5750027c854dbe5a671c56c0c3d0b48026312;p=konrad%2Fqtdeclarative.git Fix GridView currentIndex test stability Change-Id: Ib3a8efdc4447712f9877b70338027efcceff558f Reviewed-by: Bea Lam --- diff --git a/tests/auto/declarative/qquickgridview/data/gridview-initCurrent.qml b/tests/auto/declarative/qquickgridview/data/gridview-initCurrent.qml index e3ec8f2..624f639 100644 --- a/tests/auto/declarative/qquickgridview/data/gridview-initCurrent.qml +++ b/tests/auto/declarative/qquickgridview/data/gridview-initCurrent.qml @@ -58,6 +58,7 @@ Rectangle { cellWidth: 80 cellHeight: 60 delegate: myDelegate + highlightMoveDuration: 400 model: testModel header: root.showHeader ? headerFooter : null footer: root.showFooter ? headerFooter : null diff --git a/tests/auto/declarative/qquickgridview/tst_qquickgridview.cpp b/tests/auto/declarative/qquickgridview/tst_qquickgridview.cpp index 7174232..3225878 100644 --- a/tests/auto/declarative/qquickgridview/tst_qquickgridview.cpp +++ b/tests/auto/declarative/qquickgridview/tst_qquickgridview.cpp @@ -1365,6 +1365,9 @@ void tst_QQuickGridView::currentIndex() gridview->moveCurrentIndexLeft(); QCOMPARE(gridview->currentIndex(), 35); + // wait until motion stops + QTRY_VERIFY(gridview->verticalVelocity() == 0.0); + // no wrap gridview->setCurrentIndex(0); QCOMPARE(gridview->currentIndex(), 0);