diff options
author | Johan Klokkhammer Helsing <johan.helsing@qt.io> | 2018-06-07 13:30:45 +0200 |
---|---|---|
committer | Johan Helsing <johan.helsing@qt.io> | 2018-06-29 10:16:00 +0000 |
commit | 3be141d5bc199080b524d8f6f5ce514e8f74d23a (patch) | |
tree | 50ef0a09ed576aaa80255adae4bd66722685359f /tests/auto | |
parent | 4b5afc788f8f476a7bb2f57872ad8a017bf0c870 (diff) |
tst_QMenu: Skip tests when window activation is not supported
Makes sure the tests are skipped on Wayland.
Task-number: QTBUG-62188
Change-Id: Ia50d6cc02fbbac0fb6b77a16eb6372c1adb422d8
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp b/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp index 8efacc6097..f5c8d59393 100644 --- a/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp +++ b/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp @@ -29,6 +29,7 @@ #include <QtTest/QtTest> #include <QtTest/private/qtesthelpers_p.h> #include <qapplication.h> +#include <private/qguiapplication_p.h> #include <QPushButton> #include <QMainWindow> #include <QMenuBar> @@ -48,6 +49,7 @@ #include <qdebug.h> #include <qpa/qplatformtheme.h> +#include <qpa/qplatformintegration.h> using namespace QTestPrivate; @@ -459,6 +461,9 @@ void tst_QMenu::focus() void tst_QMenu::overrideMenuAction() { + if (!QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::WindowActivation)) + QSKIP("Window activation is not supported"); + //test the override menu action by first creating an action to which we set its menu QMainWindow w; w.resize(300, 200); @@ -614,6 +619,9 @@ static QMenu *getTornOffMenu() void tst_QMenu::tearOff() { + if (!QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::WindowActivation)) + QSKIP("Window activation is not supported"); + QWidget widget; QScopedPointer<QMenu> menu(new QMenu(&widget)); QVERIFY(!menu->isTearOffEnabled()); //default value @@ -686,6 +694,9 @@ void tst_QMenu::tearOff() void tst_QMenu::submenuTearOffDontClose() { + if (!QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::WindowActivation)) + QSKIP("Window activation is not supported"); + QWidget widget; QMenu *menu = new QMenu(&widget); QVERIFY(!menu->isTearOffEnabled()); //default value @@ -1236,6 +1247,8 @@ public: void tst_QMenu::QTBUG47515_widgetActionEnterLeave() { + if (!QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::WindowActivation)) + QSKIP("Window activation is not supported"); if (QGuiApplication::platformName() == QLatin1String("cocoa")) QSKIP("See QTBUG-63031"); @@ -1634,6 +1647,8 @@ void tst_QMenu::menuSize_Scrolling() void tst_QMenu::tearOffMenuNotDisplayed() { + if (!QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::WindowActivation)) + QSKIP("Window activation is not supported"); QWidget widget; QScopedPointer<QMenu> menu(new QMenu(&widget)); menu->setTearOffEnabled(true); @@ -1669,6 +1684,9 @@ void tst_QMenu::tearOffMenuNotDisplayed() void tst_QMenu::QTBUG_61039_menu_shortcuts() { + if (!QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::WindowActivation)) + QSKIP("Window activation is not supported"); + QAction *actionKamen = new QAction("Action Kamen"); actionKamen->setShortcut(QKeySequence(QLatin1String("K"))); |