diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2021-12-10 16:27:43 +0100 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2021-12-11 00:51:26 +0100 |
commit | bea06407bc14e6c5d2102a64f4f8dcb8eca8f515 (patch) | |
tree | a281060e9f5f690da8401684ae148aee788f839c /tests/auto/quick/pointerhandlers/qquickhoverhandler/tst_qquickhoverhandler.cpp | |
parent | 77c46e8d359014f8916db97b05f1922e7906c4d1 (diff) |
macOS: Skip test only if cursor can't be moved
It's not ideal to use QCursor::setPos in tests (see QTBUG-76312) to test
mouse related user input code, but it usually works locally (perhaps
after giving permissions) and in CI as well (once provisioned correctly)
so at least try to move the cursor, and only skip if the position isn't
taken.
Task-number: QTBUG-76312
Task-number: QTBUG-98492
Pick-to: 6.2
Change-Id: Ic0db2f6de71da389486e0cb74815f59878ac63d2
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'tests/auto/quick/pointerhandlers/qquickhoverhandler/tst_qquickhoverhandler.cpp')
-rw-r--r-- | tests/auto/quick/pointerhandlers/qquickhoverhandler/tst_qquickhoverhandler.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/tests/auto/quick/pointerhandlers/qquickhoverhandler/tst_qquickhoverhandler.cpp b/tests/auto/quick/pointerhandlers/qquickhoverhandler/tst_qquickhoverhandler.cpp index 5cafaf42ea..b26a055e60 100644 --- a/tests/auto/quick/pointerhandlers/qquickhoverhandler/tst_qquickhoverhandler.cpp +++ b/tests/auto/quick/pointerhandlers/qquickhoverhandler/tst_qquickhoverhandler.cpp @@ -398,12 +398,11 @@ void tst_HoverHandler::window() // QTBUG-98717 #if QT_CONFIG(cursor) if (isPlatformWayland()) QSKIP("Wayland: QCursor::setPos() doesn't work."); -#ifdef Q_OS_MACOS - QSKIP("macOS: QCursor::setPos() doesn't work (QTBUG-76312)."); -#endif auto cursorPos = window->mapToGlobal(QPoint(100, 100)); qCDebug(lcPointerTests) << "in window @" << window->position() << "setting cursor pos" << cursorPos; QCursor::setPos(cursorPos); + if (!QTest::qWaitFor([cursorPos]{ return QCursor::pos() == cursorPos; })) + QSKIP("QCursor::setPos() doesn't work (QTBUG-76312)."); QTRY_COMPARE(window->cursor().shape(), Qt::OpenHandCursor); #endif } |