diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2018-06-29 08:42:25 +0200 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2018-06-29 14:42:27 +0000 |
commit | b8aecb02ade333c34216a6313282150a3211ac4f (patch) | |
tree | a4a76de69b93d234e4813dff2cb13815841b083e /tests/auto/quick/pointerhandlers/flickableinterop | |
parent | 73258eca7ab7e3981d9f4aaa5484020cb67854a0 (diff) |
Add cat. logging in wantsEventPoint; improve FlickableInterop test
It was too hard to debug behavior in this test.
Change-Id: Iaec9534cca17bdd90b94cfa8fa8b21b7026839ae
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'tests/auto/quick/pointerhandlers/flickableinterop')
-rw-r--r-- | tests/auto/quick/pointerhandlers/flickableinterop/data/flickableWithHandlers.qml | 8 | ||||
-rw-r--r-- | tests/auto/quick/pointerhandlers/flickableinterop/tst_flickableinterop.cpp | 45 |
2 files changed, 19 insertions, 34 deletions
diff --git a/tests/auto/quick/pointerhandlers/flickableinterop/data/flickableWithHandlers.qml b/tests/auto/quick/pointerhandlers/flickableinterop/data/flickableWithHandlers.qml index 7d7f53dd15..3bdc564a47 100644 --- a/tests/auto/quick/pointerhandlers/flickableinterop/data/flickableWithHandlers.qml +++ b/tests/auto/quick/pointerhandlers/flickableinterop/data/flickableWithHandlers.qml @@ -47,7 +47,7 @@ Rectangle { Row { spacing: 6 Slider { - label: "DragHandler" + label: "DH Slider" objectName: "Slider" value: 49; width: 100; height: 400 } @@ -80,6 +80,7 @@ Rectangle { objectName: "drag" DragHandler { id: drag1 + objectName: "drag1" } Text { anchors.centerIn: parent @@ -96,6 +97,7 @@ Rectangle { border.width: 3 TapHandler { id: tap1 + objectName: "tap1" gesturePolicy: TapHandler.DragThreshold } Text { @@ -113,9 +115,11 @@ Rectangle { objectName: "dragAndTap" DragHandler { id: drag2 + objectName: "drag2" } TapHandler { id: tap2 + objectName: "tap2" gesturePolicy: TapHandler.DragThreshold } Text { @@ -133,10 +137,12 @@ Rectangle { objectName: "tapAndDrag" TapHandler { id: tap3 + objectName: "tap3" gesturePolicy: TapHandler.DragThreshold } DragHandler { id: drag3 + objectName: "drag3" } Text { anchors.centerIn: parent diff --git a/tests/auto/quick/pointerhandlers/flickableinterop/tst_flickableinterop.cpp b/tests/auto/quick/pointerhandlers/flickableinterop/tst_flickableinterop.cpp index f3513881cd..187463be2e 100644 --- a/tests/auto/quick/pointerhandlers/flickableinterop/tst_flickableinterop.cpp +++ b/tests/auto/quick/pointerhandlers/flickableinterop/tst_flickableinterop.cpp @@ -602,39 +602,18 @@ void tst_FlickableInterop::touchDragSliderAndFlickable() QPoint p2(300,300); QTest::touchEvent(window, touchDevice).stationary(1).press(2, p2, window); QQuickTouchUtils::flush(window); - p1 += QPoint(-10, -10); - p2 += QPoint(dragThreshold, 0); - QTest::touchEvent(window, touchDevice).move(1, p1, window).stationary(2); - QQuickTouchUtils::flush(window); - p1 += QPoint(-10, -10); - p2 += QPoint(dragThreshold, 0); - QTest::touchEvent(window, touchDevice).stationary(1).move(2, p2, window); - QQuickTouchUtils::flush(window); - p1 += QPoint(-10, -10); - p2 += QPoint(dragThreshold, 0); - QTest::touchEvent(window, touchDevice).move(1, p1, window).stationary(2); - QQuickTouchUtils::flush(window); - p1 += QPoint(-10, -10); - p2 += QPoint(dragThreshold, 0); - QTest::touchEvent(window, touchDevice).stationary(1).move(2, p2, window); - QQuickTouchUtils::flush(window); - p1 += QPoint(-10, -10); - p2 += QPoint(dragThreshold, 0); - QTest::touchEvent(window, touchDevice).move(1, p1, window).stationary(2); - QQuickTouchUtils::flush(window); - p1 += QPoint(-10, -10); - p2 += QPoint(dragThreshold, 0); - QTest::touchEvent(window, touchDevice).stationary(1).move(2, p2, window); - QQuickTouchUtils::flush(window); - p1 += QPoint(-10, -10); - p2 += QPoint(dragThreshold, 0); - QTest::touchEvent(window, touchDevice).move(1, p1, window).stationary(2); - QQuickTouchUtils::flush(window); - p1 += QPoint(-10, -10); - p2 += QPoint(dragThreshold, 0); - QTest::touchEvent(window, touchDevice).stationary(1).move(2, p2, window); - QQuickTouchUtils::flush(window); - QTRY_VERIFY(flickable->isMoving()); + for (int i = 0; i < 4; ++i) { + p1 += QPoint(-10, -10); + p2 += QPoint(dragThreshold, 0); + QTest::touchEvent(window, touchDevice).move(1, p1, window).stationary(2); + QQuickTouchUtils::flush(window); + p1 += QPoint(-10, -10); + p2 += QPoint(dragThreshold, 0); + QTest::touchEvent(window, touchDevice).stationary(1).move(2, p2, window); + QQuickTouchUtils::flush(window); + qCDebug(lcPointerTests) << "step" << i << ": fingers @" << p1 << p2 << "is Flickable moving yet?" << flickable->isMoving(); + } + QVERIFY(flickable->isMoving()); qreal knobSliderXOffset = qAbs(knob->mapToScene(knob->clipRect().center()).toPoint().x() - slider->mapToScene(slider->clipRect().center()).toPoint().x()) - initialXOffset; if (knobSliderXOffset > 1) |