Make tst_QQuickListView::margins() more reliable
authorBea Lam <bea.lam@nokia.com>
Wed, 4 Jan 2012 23:36:31 +0000 (09:36 +1000)
committerQt by Nokia <qt-info@nokia.com>
Thu, 5 Jan 2012 01:42:34 +0000 (02:42 +0100)
Change-Id: Ib66f5717316b4c8d71dbef408afbbb9b0698ad7a
Reviewed-by: Martin Jones <martin.jones@nokia.com>
tests/auto/qtquick2/qquicklistview/tst_qquicklistview.cpp

index 73b4d03..075c0c4 100644 (file)
@@ -3994,8 +3994,9 @@ void tst_QQuickListView::margins()
     // and yOrigin is updated
     listview->setContentY(100);
     model.removeItem(1);
-    QTest::qWait(100);
+    QTRY_COMPARE(listview->count(), model.count());
     listview->setContentY(-50);
+    QTRY_COMPARE(QQuickItemPrivate::get(listview)->polishScheduled, false);
     listview->returnToBounds();
     QCOMPARE(listview->yOrigin(), 20.);
     QTRY_COMPARE(listview->contentY(), -10.);