aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/pointerhandlers
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2020-10-27 09:30:03 +0100
committerShawn Rutledge <shawn.rutledge@qt.io>2020-10-27 13:30:00 +0100
commit7b067ae4f7b3093955bad52a694d5427b0ee588e (patch)
tree305251c571f5fbddae1dc57f15bb351fbfe9e352 /tests/auto/quick/pointerhandlers
parent03d81887d7edc49bcd76d653a4283336d68b21a6 (diff)
Fix tst_MouseAreaInterop::dragHandlerInSiblingStealing…ViaTouch()
Check the actual touchpoint's grabbers instead of the synth-mouse. Anyway it looked odd to press touchPoint ID 1 and then look for the persistent point with ID 0 on the primary pointing device, which isn't always a mouse. Task-number: QTBUG-86729 Change-Id: I0a27fdd931059b30b0b5a54328bbef6254d26e04 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'tests/auto/quick/pointerhandlers')
-rw-r--r--tests/auto/quick/pointerhandlers/mousearea_interop/BLACKLIST2
-rw-r--r--tests/auto/quick/pointerhandlers/mousearea_interop/tst_mousearea_interop.cpp13
2 files changed, 8 insertions, 7 deletions
diff --git a/tests/auto/quick/pointerhandlers/mousearea_interop/BLACKLIST b/tests/auto/quick/pointerhandlers/mousearea_interop/BLACKLIST
deleted file mode 100644
index 3ca1bf70c1..0000000000
--- a/tests/auto/quick/pointerhandlers/mousearea_interop/BLACKLIST
+++ /dev/null
@@ -1,2 +0,0 @@
-[dragHandlerInSiblingStealingGrabFromMouseAreaViaTouch]
-macos # QTBUG-86729
diff --git a/tests/auto/quick/pointerhandlers/mousearea_interop/tst_mousearea_interop.cpp b/tests/auto/quick/pointerhandlers/mousearea_interop/tst_mousearea_interop.cpp
index 44d0e9a27a..4709622245 100644
--- a/tests/auto/quick/pointerhandlers/mousearea_interop/tst_mousearea_interop.cpp
+++ b/tests/auto/quick/pointerhandlers/mousearea_interop/tst_mousearea_interop.cpp
@@ -126,7 +126,7 @@ void tst_MouseAreaInterop::dragHandlerInSiblingStealingGrabFromMouseAreaViaTouch
QScopedPointer<QQuickView> windowPtr;
createView(windowPtr, "dragTakeOverFromSibling.qml");
QQuickView * window = windowPtr.data();
- auto devPriv = QPointingDevicePrivate::get(QPointingDevice::primaryPointingDevice());
+ auto devPriv = QPointingDevicePrivate::get(touchDevice);
QPointer<QQuickPointerHandler> handler = window->rootObject()->findChild<QQuickPointerHandler*>();
QVERIFY(handler);
@@ -139,9 +139,12 @@ void tst_MouseAreaInterop::dragHandlerInSiblingStealingGrabFromMouseAreaViaTouch
touch.press(1, p1).commit();
QQuickTouchUtils::flush(window);
- QTRY_VERIFY(devPriv->pointById(0)->passiveGrabbers.contains(handler.data()));
- QCOMPARE(devPriv->pointById(0)->exclusiveGrabber, ma);
- QCOMPARE(window->mouseGrabberItem(), ma);
+ QTRY_VERIFY(!devPriv->activePoints.isEmpty());
+ qCDebug(lcPointerTests) << "active point after press:" << devPriv->activePoints.values().first().eventPoint;
+ auto epd = devPriv->queryPointById(1);
+ QVERIFY(epd);
+ QVERIFY(epd->passiveGrabbers.contains(handler.data()));
+ QCOMPARE(epd->exclusiveGrabber, ma);
QCOMPARE(ma->pressed(), true);
// Start dragging
@@ -152,7 +155,7 @@ void tst_MouseAreaInterop::dragHandlerInSiblingStealingGrabFromMouseAreaViaTouch
p1 += QPoint(dragThreshold / 2, 0);
touch.move(1, p1).commit();
QQuickTouchUtils::flush(window);
- if (!dragStoleGrab && devPriv->pointById(0)->exclusiveGrabber == handler)
+ if (!dragStoleGrab && epd->exclusiveGrabber == handler)
dragStoleGrab = i;
}
if (dragStoleGrab)