aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/quick/qquickflickable/tst_qquickflickable.cpp')
-rw-r--r--tests/auto/quick/qquickflickable/tst_qquickflickable.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp b/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp
index 2ed42e7f0f..f926dbe8f0 100644
--- a/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp
+++ b/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp
@@ -443,11 +443,14 @@ void tst_qquickflickable::movingAndDragging()
// Vertical with a quick press-move-release: should cause a flick in release.
QSignalSpy vFlickSpy(flickable, SIGNAL(flickingVerticallyChanged()));
-
- QTest::mousePress(canvas, Qt::LeftButton, 0, QPoint(50, 90));
- QTest::qWait(10);
- QTest::mouseMove(canvas, QPoint(50, 40));
- QTest::mouseRelease(canvas, Qt::LeftButton, 0, QPoint(50, 40));
+ // Use something that generates a huge velocity just to make it testable.
+ // In practice this feature matters on touchscreen devices where the
+ // underlying drivers will hopefully provide a pre-calculated velocity
+ // (based on more data than what the UI gets), thus making this use case
+ // working even with small movements.
+ QTest::mousePress(canvas, Qt::LeftButton, 0, QPoint(50, 10));
+ QTest::mouseMove(canvas, QPoint(50, 300), 10);
+ QTest::mouseRelease(canvas, Qt::LeftButton, 0, QPoint(50, 100), 10);
QCOMPARE(vFlickSpy.count(), 1);