aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickgridview
diff options
context:
space:
mode:
authorKari Oikarinen <kari.oikarinen@qt.io>2018-02-20 18:07:34 +0200
committerKari Oikarinen <kari.oikarinen@qt.io>2018-02-22 08:20:18 +0000
commit92a7610e16be9b13d54378f9dad68fa498fa6c37 (patch)
tree67f125c0b164d48234b110656bf87bfe91244617 /tests/auto/quick/qquickgridview
parentab03ee7b7e12ae64556513e4791b0d4d55ea26c4 (diff)
Fix flakiness of tst_QQuickGridView::currentIndex
Highlight item is moved with an animation, so the test may need to wait for the animation to finish until the y coordinates of the current item and the highlight item match. Task-number: QTBUG-66549 Change-Id: Id8e329c4a6647ee946da702b489c6f7ea0b7260f Reviewed-by: Sami Nurmenniemi <sami.nurmenniemi@qt.io> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Diffstat (limited to 'tests/auto/quick/qquickgridview')
-rw-r--r--tests/auto/quick/qquickgridview/tst_qquickgridview.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp b/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp
index ce04dc3c80..58c9ffce71 100644
--- a/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp
+++ b/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp
@@ -1843,7 +1843,8 @@ void tst_QQuickGridView::currentIndex()
// currentItem should be in view
QCOMPARE(gridview->currentIndex(), 35);
QCOMPARE(gridview->currentItem(), findItem<QQuickItem>(contentItem, "wrapper", 35));
- QCOMPARE(gridview->currentItem()->y(), gridview->highlightItem()->y());
+ // Wait for possible animation to finish
+ QTRY_COMPARE(gridview->currentItem()->y(), gridview->highlightItem()->y());
QCOMPARE(gridview->contentY(), 400.0);
// changing model should reset currentIndex to 0