aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.p.agocs@nokia.com>2012-04-03 12:24:52 +0300
committerQt by Nokia <qt-info@nokia.com>2012-04-05 09:50:05 +0200
commitaa959012a82900ea90a13129af4a5c43b155b4e2 (patch)
tree4f6d86d870b98477d2493adabe9e915b2175b7b4 /tests/auto/quick/qquickflickable/tst_qquickflickable.cpp
parent664a0e3f498db65f74b0e0181a0ec76cd6691a34 (diff)
Properly copy all event parameters in deliverMouseEvent()
Timestamp and capabilities were missing. One of the very special flick test cases needs to be fixed, because setting the proper timestamp will now generate correct velocities. A potentially dangerous, legacy implementation of flick() has also been updated to match how QTestLib works in Qt 5. Change-Id: Ibc99f7212ba21d41a419eaadac2fdda730658dc6 Reviewed-by: Martin Jones <martin.jones@nokia.com>
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);