From b3e5750027c854dbe5a671c56c0c3d0b48026312 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Mon, 21 Nov 2011 15:48:46 +1000 Subject: Fix GridView currentIndex test stability Change-Id: Ib3a8efdc4447712f9877b70338027efcceff558f Reviewed-by: Bea Lam --- tests/auto/declarative/qquickgridview/data/gridview-initCurrent.qml | 1 + tests/auto/declarative/qquickgridview/tst_qquickgridview.cpp | 3 +++ 2 files changed, 4 insertions(+) (limited to 'tests') diff --git a/tests/auto/declarative/qquickgridview/data/gridview-initCurrent.qml b/tests/auto/declarative/qquickgridview/data/gridview-initCurrent.qml index e3ec8f2d4a..624f639962 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 717423244e..322587876b 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); -- cgit v1.2.3