aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2012-03-13 10:32:48 +1000
committerQt by Nokia <qt-info@nokia.com>2012-03-13 03:24:54 +0100
commit648c80c4c0759efb6e35fac7acc8daad5aab13e2 (patch)
treefb99439de348c772dcbe32cfeb82869518551e99 /tests
parentc53f6093a7f0f463aad88d5c8527474f164fab20 (diff)
Speed up view flick tests.
Change-Id: I98b0a45b5afd0150bfacef2c1c1e814f70ae042f Reviewed-by: Bea Lam <bea.lam@nokia.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/quick/qquickgridview/data/snapOneRow.qml2
-rw-r--r--tests/auto/quick/qquickgridview/data/snapToRow.qml2
-rw-r--r--tests/auto/quick/qquickgridview/tst_qquickgridview.cpp35
-rw-r--r--tests/auto/quick/qquicklistview/data/snapToItem.qml2
-rw-r--r--tests/auto/quick/qquicklistview/tst_qquicklistview.cpp14
5 files changed, 26 insertions, 29 deletions
diff --git a/tests/auto/quick/qquickgridview/data/snapOneRow.qml b/tests/auto/quick/qquickgridview/data/snapOneRow.qml
index 3d32d75c45..597c5efa9c 100644
--- a/tests/auto/quick/qquickgridview/data/snapOneRow.qml
+++ b/tests/auto/quick/qquickgridview/data/snapOneRow.qml
@@ -37,7 +37,7 @@ Rectangle {
flow: GridView.TopToBottom
highlightRangeMode: GridView.StrictlyEnforceRange
highlight: Rectangle { width: 120; height: 120; color: "yellow" }
- model: 10
+ model: 8
delegate: myDelegate
}
diff --git a/tests/auto/quick/qquickgridview/data/snapToRow.qml b/tests/auto/quick/qquickgridview/data/snapToRow.qml
index f079a048f0..e3963b0c4a 100644
--- a/tests/auto/quick/qquickgridview/data/snapToRow.qml
+++ b/tests/auto/quick/qquickgridview/data/snapToRow.qml
@@ -37,7 +37,7 @@ Rectangle {
flow: GridView.TopToBottom
highlightRangeMode: GridView.StrictlyEnforceRange
highlight: Rectangle { width: 80; height: 80; color: "yellow" }
- model: 54
+ model: 39
delegate: myDelegate
}
diff --git a/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp b/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp
index fe534e4565..7d004915a6 100644
--- a/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp
+++ b/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp
@@ -694,8 +694,7 @@ void tst_QQuickGridView::removed()
QTRY_VERIFY(gridview->currentItem() != oldCurrent);
gridview->setContentY(0);
- // let transitions settle.
- QTest::qWait(300);
+ QTRY_COMPARE(QQuickItemPrivate::get(gridview)->polishScheduled, false);
// Confirm items positioned correctly
itemCount = findItems<QQuickItem>(contentItem, "wrapper").count();
@@ -969,7 +968,7 @@ void tst_QQuickGridView::addOrRemoveBeforeVisible()
QTRY_COMPARE(gridview->currentIndex(), 24);
QTRY_COMPARE(gridview->contentY(), 220.0);
- QTest::qWait(100); // wait for refill to complete
+ QTRY_COMPARE(QQuickItemPrivate::get(gridview)->polishScheduled, false);
QTRY_VERIFY(!findItem<QQuickItem>(contentItem, "wrapper", 0)); // 0 shouldn't be visible
if (doAdd) {
@@ -3574,22 +3573,22 @@ void tst_QQuickGridView::snapToRow_data()
QTest::addColumn<qreal>("startExtent");
QTest::newRow("vertical, left to right") << QQuickGridView::LeftToRight << Qt::LeftToRight << int(QQuickItemView::NoHighlightRange)
- << QPoint(20, 200) << QPoint(20, 20) << 60.0 << 1200.0 << 0.0;
+ << QPoint(20, 200) << QPoint(20, 20) << 60.0 << 800.0 << 0.0;
QTest::newRow("horizontal, left to right") << QQuickGridView::TopToBottom << Qt::LeftToRight << int(QQuickItemView::NoHighlightRange)
- << QPoint(200, 20) << QPoint(20, 20) << 60.0 << 1200.0 << 0.0;
+ << QPoint(200, 20) << QPoint(20, 20) << 60.0 << 800.0 << 0.0;
QTest::newRow("horizontal, right to left") << QQuickGridView::TopToBottom << Qt::RightToLeft << int(QQuickItemView::NoHighlightRange)
- << QPoint(20, 20) << QPoint(200, 20) << -60.0 << -1200.0 - 240.0 << -240.0;
+ << QPoint(20, 20) << QPoint(200, 20) << -60.0 << -800.0 - 240.0 << -240.0;
QTest::newRow("vertical, left to right, enforce range") << QQuickGridView::LeftToRight << Qt::LeftToRight << int(QQuickItemView::StrictlyEnforceRange)
- << QPoint(20, 200) << QPoint(20, 20) << 60.0 << 1340.0 << -20.0;
+ << QPoint(20, 200) << QPoint(20, 20) << 60.0 << 940.0 << -20.0;
QTest::newRow("horizontal, left to right, enforce range") << QQuickGridView::TopToBottom << Qt::LeftToRight << int(QQuickItemView::StrictlyEnforceRange)
- << QPoint(200, 20) << QPoint(20, 20) << 60.0 << 1340.0 << -20.0;
+ << QPoint(200, 20) << QPoint(20, 20) << 60.0 << 940.0 << -20.0;
QTest::newRow("horizontal, right to left, enforce range") << QQuickGridView::TopToBottom << Qt::RightToLeft << int(QQuickItemView::StrictlyEnforceRange)
- << QPoint(20, 20) << QPoint(200, 20) << -60.0 << -1200.0 - 240.0 - 140.0 << -220.0;
+ << QPoint(20, 20) << QPoint(200, 20) << -60.0 << -800.0 - 240.0 - 140.0 << -220.0;
}
void tst_QQuickGridView::snapToRow()
@@ -3669,22 +3668,22 @@ void tst_QQuickGridView::snapOneRow_data()
QTest::addColumn<qreal>("startExtent");
QTest::newRow("vertical, left to right") << QQuickGridView::LeftToRight << Qt::LeftToRight << int(QQuickItemView::NoHighlightRange)
- << QPoint(20, 200) << QPoint(20, 20) << 100.0 << 360.0 << 0.0;
+ << QPoint(20, 200) << QPoint(20, 20) << 100.0 << 240.0 << 0.0;
QTest::newRow("horizontal, left to right") << QQuickGridView::TopToBottom << Qt::LeftToRight << int(QQuickItemView::NoHighlightRange)
- << QPoint(200, 20) << QPoint(20, 20) << 100.0 << 360.0 << 0.0;
+ << QPoint(200, 20) << QPoint(20, 20) << 100.0 << 240.0 << 0.0;
QTest::newRow("horizontal, right to left") << QQuickGridView::TopToBottom << Qt::RightToLeft << int(QQuickItemView::NoHighlightRange)
- << QPoint(20, 20) << QPoint(200, 20) << -340.0 << -360.0 - 240.0 << -240.0;
+ << QPoint(20, 20) << QPoint(200, 20) << -340.0 << -240.0 - 240.0 << -240.0;
QTest::newRow("vertical, left to right, enforce range") << QQuickGridView::LeftToRight << Qt::LeftToRight << int(QQuickItemView::StrictlyEnforceRange)
- << QPoint(20, 200) << QPoint(20, 20) << 100.0 << 460.0 << -20.0;
+ << QPoint(20, 200) << QPoint(20, 20) << 100.0 << 340.0 << -20.0;
QTest::newRow("horizontal, left to right, enforce range") << QQuickGridView::TopToBottom << Qt::LeftToRight << int(QQuickItemView::StrictlyEnforceRange)
- << QPoint(200, 20) << QPoint(20, 20) << 100.0 << 460.0 << -20.0;
+ << QPoint(200, 20) << QPoint(20, 20) << 100.0 << 340.0 << -20.0;
QTest::newRow("horizontal, right to left, enforce range") << QQuickGridView::TopToBottom << Qt::RightToLeft << int(QQuickItemView::StrictlyEnforceRange)
- << QPoint(20, 20) << QPoint(200, 20) << -340.0 << -360.0 - 240.0 - 100.0 << -220.0;
+ << QPoint(20, 20) << QPoint(200, 20) << -340.0 << -240.0 - 240.0 - 100.0 << -220.0;
}
void tst_QQuickGridView::snapOneRow()
@@ -3739,8 +3738,8 @@ void tst_QQuickGridView::snapOneRow()
: layoutDirection == Qt::LeftToRight ? !gridview->isAtXEnd() : !gridview->isAtXBeginning());
if (QQuickItemView::HighlightRangeMode(highlightRangeMode) == QQuickItemView::StrictlyEnforceRange) {
- QCOMPARE(gridview->currentIndex(), 8);
- QCOMPARE(currentIndexSpy.count(), 4);
+ QCOMPARE(gridview->currentIndex(), 6);
+ QCOMPARE(currentIndexSpy.count(), 3);
}
if (flow == QQuickGridView::LeftToRight)
@@ -3763,7 +3762,7 @@ void tst_QQuickGridView::snapOneRow()
if (QQuickItemView::HighlightRangeMode(highlightRangeMode) == QQuickItemView::StrictlyEnforceRange) {
QCOMPARE(gridview->currentIndex(), 0);
- QCOMPARE(currentIndexSpy.count(), 8);
+ QCOMPARE(currentIndexSpy.count(), 6);
}
delete canvas;
diff --git a/tests/auto/quick/qquicklistview/data/snapToItem.qml b/tests/auto/quick/qquicklistview/data/snapToItem.qml
index 6f201072f0..91d31adfc7 100644
--- a/tests/auto/quick/qquicklistview/data/snapToItem.qml
+++ b/tests/auto/quick/qquicklistview/data/snapToItem.qml
@@ -37,7 +37,7 @@ Rectangle {
layoutDirection: Qt.RightToLeft
highlightRangeMode: ListView.StrictlyEnforceRange
highlight: Rectangle { width: 80; height: 80; color: "yellow" }
- model: 18
+ model: 10
delegate: myDelegate
}
diff --git a/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp b/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp
index 1584bc34b1..1a494183a8 100644
--- a/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp
+++ b/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp
@@ -827,7 +827,6 @@ void tst_QQuickListView::removed(const QUrl &source, bool /* animated */)
listview->setContentY(20); // That's the top now
// let transitions settle.
QTRY_COMPARE(QQuickItemPrivate::get(listview)->polishScheduled, false);
- QTest::qWait(300);
// Confirm items positioned correctly
itemCount = findItems<QQuickItem>(contentItem, "wrapper").count();
@@ -858,7 +857,6 @@ void tst_QQuickListView::removed(const QUrl &source, bool /* animated */)
listview->setContentY(80);
QTRY_COMPARE(QQuickItemPrivate::get(listview)->polishScheduled, false);
- QTest::qWait(300);
// remove all visible items
model.removeItems(1, 18);
@@ -4251,22 +4249,22 @@ void tst_QQuickListView::snapToItem_data()
QTest::addColumn<qreal>("startExtent");
QTest::newRow("vertical, left to right") << QQuickListView::Vertical << Qt::LeftToRight << int(QQuickItemView::NoHighlightRange)
- << QPoint(20, 200) << QPoint(20, 20) << 60.0 << 1200.0 << 0.0;
+ << QPoint(20, 200) << QPoint(20, 20) << 60.0 << 560.0 << 0.0;
QTest::newRow("horizontal, left to right") << QQuickListView::Horizontal << Qt::LeftToRight << int(QQuickItemView::NoHighlightRange)
- << QPoint(200, 20) << QPoint(20, 20) << 60.0 << 1200.0 << 0.0;
+ << QPoint(200, 20) << QPoint(20, 20) << 60.0 << 560.0 << 0.0;
QTest::newRow("horizontal, right to left") << QQuickListView::Horizontal << Qt::RightToLeft << int(QQuickItemView::NoHighlightRange)
- << QPoint(20, 20) << QPoint(200, 20) << -60.0 << -1200.0 - 240.0 << -240.0;
+ << QPoint(20, 20) << QPoint(200, 20) << -60.0 << -560.0 - 240.0 << -240.0;
QTest::newRow("vertical, left to right, enforce range") << QQuickListView::Vertical << Qt::LeftToRight << int(QQuickItemView::StrictlyEnforceRange)
- << QPoint(20, 200) << QPoint(20, 20) << 60.0 << 1340.0 << -20.0;
+ << QPoint(20, 200) << QPoint(20, 20) << 60.0 << 700.0 << -20.0;
QTest::newRow("horizontal, left to right, enforce range") << QQuickListView::Horizontal << Qt::LeftToRight << int(QQuickItemView::StrictlyEnforceRange)
- << QPoint(200, 20) << QPoint(20, 20) << 60.0 << 1340.0 << -20.0;
+ << QPoint(200, 20) << QPoint(20, 20) << 60.0 << 700.0 << -20.0;
QTest::newRow("horizontal, right to left, enforce range") << QQuickListView::Horizontal << Qt::RightToLeft << int(QQuickItemView::StrictlyEnforceRange)
- << QPoint(20, 20) << QPoint(200, 20) << -60.0 << -1200.0 - 240.0 - 140.0 << -220.0;
+ << QPoint(20, 20) << QPoint(200, 20) << -60.0 << -560.0 - 240.0 - 140.0 << -220.0;
}
void tst_QQuickListView::snapToItem()