aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/pointerhandlers/qquickpinchhandler/tst_qquickpinchhandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/quick/pointerhandlers/qquickpinchhandler/tst_qquickpinchhandler.cpp')
-rw-r--r--tests/auto/quick/pointerhandlers/qquickpinchhandler/tst_qquickpinchhandler.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/auto/quick/pointerhandlers/qquickpinchhandler/tst_qquickpinchhandler.cpp b/tests/auto/quick/pointerhandlers/qquickpinchhandler/tst_qquickpinchhandler.cpp
index 19fdae3b44..2b8ddd197d 100644
--- a/tests/auto/quick/pointerhandlers/qquickpinchhandler/tst_qquickpinchhandler.cpp
+++ b/tests/auto/quick/pointerhandlers/qquickpinchhandler/tst_qquickpinchhandler.cpp
@@ -217,6 +217,7 @@ void tst_QQuickPinchHandler::scale()
QQuickPinchHandler *pinchHandler = window->rootObject()->findChild<QQuickPinchHandler*>("pinchHandler");
QVERIFY(pinchHandler != nullptr);
+ QSignalSpy grabChangedSpy(pinchHandler, SIGNAL(grabChanged(QQuickEventPoint::GrabTransition, QQuickEventPoint*)));
QQuickItem *root = qobject_cast<QQuickItem*>(window->rootObject());
QVERIFY(root != nullptr);
@@ -238,6 +239,7 @@ void tst_QQuickPinchHandler::scale()
// it is outside its bounds.
pinchSequence.stationary(0).press(1, p1, window).commit();
QQuickTouchUtils::flush(window);
+ QTRY_COMPARE(grabChangedSpy.count(), 1); // passive grab
QPoint pd(10, 10);
// move one point until PinchHandler activates
@@ -247,6 +249,8 @@ void tst_QQuickPinchHandler::scale()
QQuickTouchUtils::flush(window);
}
QCOMPARE(pinchHandler->active(), true);
+ // first point got a passive grab; both points got exclusive grabs
+ QCOMPARE(grabChangedSpy.count(), 3);
QLineF line(p0, p1);
const qreal startLength = line.length();