diff options
author | J-P Nurmi <jpnurmi@digia.com> | 2014-03-05 20:25:14 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-03-06 01:01:00 +0100 |
commit | b23b32f64f32c10795d150f7f26a20e48bd9a05e (patch) | |
tree | 057622f080d2a0fd4d43974845c1968c02c93e11 /tests/auto/quick/qquickpathview | |
parent | 71ec1e0e059589940ca3791bd5bef75360014703 (diff) |
Stabilize tst_QQuickPathView:dataModel()
- QQuickPathView::setCurrentIndex() result must be immediate
=> no need for random QTest::qWait(100) there.
- Remove another random QTest::qWait(100) after inserting
a model item. Instead, wait for the desired result ie.
delegate creation with QTRY_VERIFY().
- Furthermore, disable the default highlight move duration to
avoid the auto test and QQuickPathView's internal timeline
fighting over the current index.
Task-number: QTBUG-35705
Change-Id: Ie53fdcc8f7955a03027da38b075e6042a3aea7f2
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Diffstat (limited to 'tests/auto/quick/qquickpathview')
-rw-r--r-- | tests/auto/quick/qquickpathview/data/datamodel.qml | 1 | ||||
-rw-r--r-- | tests/auto/quick/qquickpathview/tst_qquickpathview.cpp | 8 |
2 files changed, 4 insertions, 5 deletions
diff --git a/tests/auto/quick/qquickpathview/data/datamodel.qml b/tests/auto/quick/qquickpathview/data/datamodel.qml index 44f2aecc0a..4b858e233f 100644 --- a/tests/auto/quick/qquickpathview/data/datamodel.qml +++ b/tests/auto/quick/qquickpathview/data/datamodel.qml @@ -6,6 +6,7 @@ PathView { objectName: "pathview" width: 240; height: 320 pathItemCount: testObject.pathItemCount + highlightMoveDuration: 0 function checkProperties() { testObject.error = false; diff --git a/tests/auto/quick/qquickpathview/tst_qquickpathview.cpp b/tests/auto/quick/qquickpathview/tst_qquickpathview.cpp index 7235faaff7..579cb954aa 100644 --- a/tests/auto/quick/qquickpathview/tst_qquickpathview.cpp +++ b/tests/auto/quick/qquickpathview/tst_qquickpathview.cpp @@ -819,18 +819,16 @@ void tst_QQuickPathView::dataModel() QVERIFY(testItem == 0); pathview->setCurrentIndex(1); - QTRY_COMPARE(pathview->currentItem(), findItem<QQuickItem>(pathview, "wrapper", 1)); - QTest::qWait(100); + QCOMPARE(pathview->currentIndex(), 1); + QCOMPARE(pathview->currentItem(), findItem<QQuickItem>(pathview, "wrapper", 1)); model.insertItem(2, "pink", "2"); - QTest::qWait(100); QTRY_COMPARE(findItems<QQuickItem>(pathview, "wrapper").count(), 5); QCOMPARE(pathview->currentIndex(), 1); QCOMPARE(pathview->currentItem(), findItem<QQuickItem>(pathview, "wrapper", 1)); - text = findItem<QQuickText>(pathview, "myText", 2); - QVERIFY(text); + QTRY_VERIFY(text = findItem<QQuickText>(pathview, "myText", 2)); QCOMPARE(text->text(), model.name(2)); model.removeItem(3); |