diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2022-10-18 22:49:11 +0200 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2022-10-19 03:49:15 +0200 |
commit | e3343eb83f212ea8dea2f2b31859ac39c775f4ba (patch) | |
tree | 02aa869132b8c0c50a46f3b519e69ad65486c66f /tests/auto/quick/pointerhandlers/qquickhoverhandler/tst_qquickhoverhandler.cpp | |
parent | c166ca0bbecd24a1af99bab9edecbfc0c9e3b00c (diff) |
Attempt to stabilize tst_HoverHandler::deviceCursor
If the test can't send QTabletEvents, we can't use
AA_SynthesizeMouseForUnhandledTabletEvents to test device-specific
cursor conflicts. There is so little left to test that we might as well
skip it.
Since QTest::mouseMove() takes a delay argument, we don't need to use
qWait(). It should not have resulted in any flakiness, but we might
as well remove it to save a little time.
Amends 79893e1773be9d04208243cb88c1daf793d830a4
Pick-to: 6.4
Task-number: QTBUG-107763
Change-Id: Ic83a80f83fe51ad9413e21c5ca48c338d9ca3728
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tests/auto/quick/pointerhandlers/qquickhoverhandler/tst_qquickhoverhandler.cpp')
-rw-r--r-- | tests/auto/quick/pointerhandlers/qquickhoverhandler/tst_qquickhoverhandler.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/tests/auto/quick/pointerhandlers/qquickhoverhandler/tst_qquickhoverhandler.cpp b/tests/auto/quick/pointerhandlers/qquickhoverhandler/tst_qquickhoverhandler.cpp index d3981badda..7cc96f1dad 100644 --- a/tests/auto/quick/pointerhandlers/qquickhoverhandler/tst_qquickhoverhandler.cpp +++ b/tests/auto/quick/pointerhandlers/qquickhoverhandler/tst_qquickhoverhandler.cpp @@ -481,6 +481,9 @@ void tst_HoverHandler::deviceCursor_data() void tst_HoverHandler::deviceCursor() { +#if !QT_CONFIG(tabletevent) + QSKIP("This test depends on QTabletEvent delivery."); +#endif QFETCH(bool, synthMouseForTabletEvents); QFETCH(bool, earlierTabletBeforeMouse); qApp->setAttribute(Qt::AA_SynthesizeMouseForUnhandledTabletEvents, synthMouseForTabletEvents); @@ -504,7 +507,6 @@ void tst_HoverHandler::deviceCursor() QPoint point(100, 100); -#if QT_CONFIG(tabletevent) const qint64 stylusId = 1234567890; QElapsedTimer timer; timer.start(); @@ -539,13 +541,11 @@ void tst_HoverHandler::deviceCursor() testStylusDevice(QInputDevice::DeviceType::Airbrush, QPointingDevice::PointerType::Eraser, Qt::OpenHandCursor, airbrushEraserHandler); - QTest::qWait(200); qCDebug(lcPointerTests) << "---- no more tablet events, now we send a mouse move"; -#endif // move the mouse: the mouse-specific HoverHandler gets to set the cursor only if - // more than kCursorOverrideTimeout ms have elapsed - QTest::mouseMove(&window, point); + // more than kCursorOverrideTimeout ms have elapsed (100ms) + QTest::mouseMove(&window, point, 100); QTRY_COMPARE(mouseHandler->isHovered(), true); const bool afterTimeout = QQuickPointerHandlerPrivate::get(airbrushEraserHandler)->lastEventTime + 100 < @@ -559,9 +559,7 @@ void tst_HoverHandler::deviceCursor() QCOMPARE(stylusHandler->isHovered(), false); QCOMPARE(eraserHandler->isHovered(), false); QCOMPARE(aibrushHandler->isHovered(), false); -#if QT_CONFIG(tabletevent) QCOMPARE(airbrushEraserHandler->isHovered(), true); // there was no fresh QTabletEvent to tell it not to be hovered -#endif } QTEST_MAIN(tst_HoverHandler) |