aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2022-11-11 08:56:31 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-11-12 01:22:07 +0000
commit23e3e59c22579095ffc55d89aaaa822e77652773 (patch)
tree71beaf69258288794a793484c7e3896282fcb1e2 /tests
parente8d8bfeedafff47a351897e116b99982bba2d2e8 (diff)
Stabilize tst_TouchMouse::strayTouchDoesntAutograb
Apparently GrabMonitor sees all grab transitions in prior autotests up until strayTouchDoesntAutograb() runs; so it's surprising that it ever passed. Now we reset its state to initial conditions at the beginning. Amends 5ced8ec177fd730676eb854aea559a5f324a39b6 Fixes: QTBUG-108352 Change-Id: I31c398f9cd08b2281ea82054b667437f1151f0bd Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> (cherry picked from commit 195dcc11c7fbb69e78264398fcfa09c63089b606) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/quick/touchmouse/tst_touchmouse.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/auto/quick/touchmouse/tst_touchmouse.cpp b/tests/auto/quick/touchmouse/tst_touchmouse.cpp
index 99b1e0b14f..66dde3e26c 100644
--- a/tests/auto/quick/touchmouse/tst_touchmouse.cpp
+++ b/tests/auto/quick/touchmouse/tst_touchmouse.cpp
@@ -195,6 +195,14 @@ public:
bool fromMouseEvent = false;
bool canceled = false;
+ void reset()
+ {
+ exclusiveGrabber = nullptr;
+ transitionCount = 0;
+ fromMouseEvent = false;
+ canceled = false;
+ }
+
void onGrabChanged(QObject *grabber, QPointingDevice::GrabTransition transition, const QPointerEvent *event, const QEventPoint &point)
{
qCDebug(lcTests) << grabber << transition << event << point << point.device();
@@ -1641,6 +1649,7 @@ void tst_TouchMouse::strayTouchDoesntAutograb() // QTBUG-107867
eventItem->acceptMouse = true;
QCOMPARE(eventItem->acceptTouchEvents(), false); // the default in Qt 6
QPoint p1(6, 6);
+ grabMonitor.reset();
// Begin a new touch, that gets converted to a mouse press
QTest::touchEvent(&window, device).press(0, p1);