diff options
author | Mitch Curtis <mitch.curtis@qt.io> | 2022-06-28 16:05:18 +0800 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-07-01 00:51:15 +0000 |
commit | 3f42c69ecae8ea3825e7f2aa9c694837ba8f5935 (patch) | |
tree | d4cdc48d05fad8b1e1278baec78505181cb07482 /tests | |
parent | e105b81805691c18f8baff363bebe6785b0d49b3 (diff) |
tst_QQuickMenu: skip entire popup() test where necessary
If the cursor configure feature is not enabled, don't build the code.
If the platform is Android or Wayland, skip the test.
Change-Id: Ic60771decf7f2e0bd7db77c112925147015af5a6
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
(cherry picked from commit fb22bc65e2730c87dffd779668a1e74aaa3ebf7d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/quickcontrols2/qquickmenu/tst_qquickmenu.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/tests/auto/quickcontrols2/qquickmenu/tst_qquickmenu.cpp b/tests/auto/quickcontrols2/qquickmenu/tst_qquickmenu.cpp index a2d3dc9420..312c9002b4 100644 --- a/tests/auto/quickcontrols2/qquickmenu/tst_qquickmenu.cpp +++ b/tests/auto/quickcontrols2/qquickmenu/tst_qquickmenu.cpp @@ -74,7 +74,9 @@ private slots: void menuSeparator(); void repeater(); void order(); +#if QT_CONFIG(cursor) void popup(); +#endif void actions(); #if QT_CONFIG(shortcut) void actionShortcuts(); @@ -784,8 +786,15 @@ void tst_QQuickMenu::order() } } +#if QT_CONFIG(cursor) void tst_QQuickMenu::popup() { +#if defined(Q_OS_ANDROID) + QSKIP("Setting cursor position is not supported on Android"); +#endif + if (QGuiApplication::platformName().startsWith(QLatin1String("wayland"))) + QSKIP("Setting cursor position is not supported on Wayland"); + QQuickControlsApplicationHelper helper(this, QLatin1String("popup.qml")); QVERIFY2(helper.ready, helper.failureMessage()); QQuickApplicationWindow *window = helper.appWindow; @@ -809,8 +818,6 @@ void tst_QQuickMenu::popup() QQuickItem *button = window->property("button").value<QQuickItem *>(); QVERIFY(button); - // Android does not support settings cursor position -#if QT_CONFIG(cursor) && !defined(Q_OS_ANDROID) QPoint oldCursorPos = QCursor::pos(); QPoint cursorPos = window->mapToGlobal(QPoint(11, 22)); QCursor::setPos(cursorPos); @@ -939,8 +946,8 @@ void tst_QQuickMenu::popup() QCursor::setPos(oldCursorPos); QTRY_COMPARE(QCursor::pos(), oldCursorPos); -#endif } +#endif // QT_CONFIG(cursor) void tst_QQuickMenu::actions() { |