Fix GridView currentIndex test stability
authorMartin Jones <martin.jones@nokia.com>
Mon, 21 Nov 2011 05:48:46 +0000 (15:48 +1000)
committerQt by Nokia <qt-info@nokia.com>
Mon, 21 Nov 2011 06:41:07 +0000 (07:41 +0100)
Change-Id: Ib3a8efdc4447712f9877b70338027efcceff558f
Reviewed-by: Bea Lam <bea.lam@nokia.com>

tests/auto/declarative/qquickgridview/data/gridview-initCurrent.qml
tests/auto/declarative/qquickgridview/tst_qquickgridview.cpp

index e3ec8f2..624f639 100644 (file)
@@ -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
index 7174232..3225878 100644 (file)
@@ -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);