From 52484cc4b6696c8a5c1f69125d81eb0cede8cdb2 Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Fri, 11 Oct 2019 15:21:54 +0200 Subject: Widget tests: Skip tests that fail on Wayland Either by testing for platform name or window activation. After this gets in, we can enable widget tests in the Wayland bot, which hopefully will reduce the number of regressions in the Wayland plugin. Fixes: QTBUG-62188 Change-Id: I71ce8abd6b5891e5b953126b1c35345892585931 Reviewed-by: Paul Olav Tvete --- .../qgraphicspixmapitem/tst_qgraphicspixmapitem.cpp | 3 +++ .../graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp | 15 +++++++++++++++ .../graphicsview/qgraphicsview/tst_qgraphicsview.cpp | 17 +++++++++++++++++ 3 files changed, 35 insertions(+) (limited to 'tests/auto/widgets/graphicsview') diff --git a/tests/auto/widgets/graphicsview/qgraphicspixmapitem/tst_qgraphicspixmapitem.cpp b/tests/auto/widgets/graphicsview/qgraphicspixmapitem/tst_qgraphicspixmapitem.cpp index 78fe448bdb..f7e7022059 100644 --- a/tests/auto/widgets/graphicsview/qgraphicspixmapitem/tst_qgraphicspixmapitem.cpp +++ b/tests/auto/widgets/graphicsview/qgraphicspixmapitem/tst_qgraphicspixmapitem.cpp @@ -152,6 +152,9 @@ void tst_QGraphicsPixmapItem::contains_data() // public bool contains(QPointF const& point) const void tst_QGraphicsPixmapItem::contains() { + if (QGuiApplication::platformName().startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) + QSKIP("Wayland: This fails. Figure out why."); + QFETCH(QPixmap, pixmap); QFETCH(QPointF, point); QFETCH(bool, contains); diff --git a/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp b/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp index 950f3ef670..b49d2cd8b0 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp +++ b/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp @@ -3078,6 +3078,9 @@ void tst_QGraphicsScene::tabFocus_emptyScene() void tst_QGraphicsScene::tabFocus_sceneWithFocusableItems() { + if (!QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::WindowActivation)) + QSKIP("Window activation is not supported"); + QGraphicsScene scene; QGraphicsTextItem *item = scene.addText("Qt rocks!"); item->setTabChangesFocus(true); @@ -3218,6 +3221,9 @@ protected: void tst_QGraphicsScene::tabFocus_sceneWithFocusWidgets() { + if (!QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::WindowActivation)) + QSKIP("Window activation is not supported"); + QGraphicsScene scene; FocusWidget *widget1 = new FocusWidget; @@ -3287,6 +3293,9 @@ void tst_QGraphicsScene::tabFocus_sceneWithFocusWidgets() void tst_QGraphicsScene::tabFocus_sceneWithNestedFocusWidgets() { + if (!QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::WindowActivation)) + QSKIP("Window activation is not supported"); + QGraphicsScene scene; FocusWidget *widget1 = new FocusWidget; @@ -3811,6 +3820,9 @@ public: void tst_QGraphicsScene::inputMethod() { + if (QGuiApplication::platformName().startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) + QSKIP("Wayland: This fails. Figure out why."); + PlatformInputContext inputContext; QInputMethodPrivate *inputMethodPrivate = QInputMethodPrivate::get(QGuiApplication::inputMethod()); @@ -4054,6 +4066,9 @@ void tst_QGraphicsScene::polishItems2() void tst_QGraphicsScene::isActive() { + if (!QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::WindowActivation)) + QSKIP("Window activation is not supported"); + #if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED) QSKIP("Fails on Android (QTBUG-44430)"); #endif diff --git a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp index e21b1b889a..cf8066c7a3 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp +++ b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp @@ -418,6 +418,9 @@ void tst_QGraphicsView::alignment() void tst_QGraphicsView::interactive() { + if (!QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::WindowActivation)) + QSKIP("Window activation is not supported"); + TestItem *item = new TestItem; item->setFlags(QGraphicsItem::ItemIsMovable); QCOMPARE(item->events.size(), 0); @@ -3297,6 +3300,9 @@ void tst_QGraphicsView::task186827_deleteReplayedItem() void tst_QGraphicsView::task207546_focusCrash() { + if (!QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::WindowActivation)) + QSKIP("Window activation is not supported"); + class _Widget : public QWidget { public: @@ -3641,6 +3647,8 @@ void tst_QGraphicsView::moveItemWhileScrolling() int a = adjustForAntialiasing ? 2 : 1; expectedRegion += QRect(40, 50, 10, 10).adjusted(-a, -a, a, a); expectedRegion += QRect(40, 60, 10, 10).adjusted(-a, -a, a, a); + if (QGuiApplication::platformName().startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) + QSKIP("Wayland: This fails. Figure out why."); COMPARE_REGIONS(view.lastPaintedRegion, expectedRegion); } @@ -4394,6 +4402,9 @@ void tst_QGraphicsView::inputMethodSensitivity() void tst_QGraphicsView::inputContextReset() { + if (!QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::WindowActivation)) + QSKIP("Window activation is not supported"); + PlatformInputContext inputContext; QInputMethodPrivate *inputMethodPrivate = QInputMethodPrivate::get(qApp->inputMethod()); inputMethodPrivate->testContext = &inputContext; @@ -4652,6 +4663,9 @@ void tst_QGraphicsView::QTBUG_4151_clipAndIgnore_data() void tst_QGraphicsView::QTBUG_4151_clipAndIgnore() { + if (QGuiApplication::platformName().startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) + QSKIP("Wayland: This fails. Figure out why."); + QFETCH(bool, clip); QFETCH(bool, ignoreTransformations); QFETCH(int, numItems); @@ -4834,6 +4848,9 @@ QRectF IMItem::mf(1.5, 1.6, 10, 10); void tst_QGraphicsView::QTBUG_16063_microFocusRect() { + if (QGuiApplication::platformName().startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) + QSKIP("Wayland: This fails. Figure out why."); + QGraphicsScene scene; IMItem *item = new IMItem(); scene.addItem(item); -- cgit v1.2.3