diff options
author | Axel Spoerl <axel.spoerl@qt.io> | 2023-01-03 09:44:50 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2023-01-03 19:21:39 +0000 |
commit | df62cefdcb0ea6f644f1560285598ed179bb2bb2 (patch) | |
tree | f2fcd4bf959f38acc9ee15ee49fe40c11bde6fbc /tests/auto/widgets/kernel | |
parent | 3b60534ab9a2f467cd44ee23a1429ed46d6d5a23 (diff) |
Skip tst_QWidget::optimizedResizeMove and ..._topLevel on wayland
Wayland omits optimizations tested in tst_QWidget::optimizedResizeMove()
and optimizedResize_topLevel() under certain circumstances, e.g. on
Ubuntu 22.04 / Gnome. This makes the test functions fail.
This patch skips the test functions on wayland platforms, if an
omission is detected.
This amends 2ec7a6322f465ad7cce3c48096d8912903196ab2.
Fixes: QTBUG-109746
Pick-to: 6.5 6.4
Change-Id: If0df6b1cf451a7f0dccfc1bb7411e895d7ae29a3
Reviewed-by: Liang Qi <liang.qi@qt.io>
Diffstat (limited to 'tests/auto/widgets/kernel')
-rw-r--r-- | tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp index 7e7cc8da7c..23d915155e 100644 --- a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp +++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp @@ -4634,6 +4634,8 @@ private: */ void tst_QWidget::optimizedResizeMove() { + const bool wayland = QGuiApplication::platformName().startsWith(QLatin1String("wayland"), Qt::CaseInsensitive); + QWidget parent; parent.setPalette(simplePalette()); parent.setWindowTitle(QTest::currentTestFunction()); @@ -4647,7 +4649,12 @@ void tst_QWidget::optimizedResizeMove() QVERIFY(staticWidget.waitForPaintEvent()); staticWidget.move(staticWidget.pos() + QPoint(10, 10)); - QVERIFY(!staticWidget.waitForPaintEvent()); + if (!wayland) { + QVERIFY(!staticWidget.waitForPaintEvent()); + } else { + if (staticWidget.waitForPaintEvent()) + QSKIP("Wayland is not optimising paint events. Skipping test."); + } staticWidget.move(staticWidget.pos() + QPoint(-10, -10)); QVERIFY(!staticWidget.waitForPaintEvent()); @@ -4694,6 +4701,8 @@ void tst_QWidget::optimizedResizeMove() void tst_QWidget::optimizedResize_topLevel() { + const bool wayland = QGuiApplication::platformName().startsWith(QLatin1String("wayland"), Qt::CaseInsensitive); + if (QHighDpiScaling::isActive()) QSKIP("Skip due to rounding errors in the regions."); StaticWidget topLevel(simplePalette()); @@ -4730,7 +4739,12 @@ void tst_QWidget::optimizedResize_topLevel() QVERIFY(topLevel.waitForPaintEvent()); if (m_platform == QStringLiteral("xcb") || m_platform == QStringLiteral("offscreen")) QSKIP("QTBUG-26424"); - QCOMPARE(topLevel.partial, true); + if (!wayland) { + QCOMPARE(topLevel.partial, true); + } else { + if (!topLevel.partial) + QSKIP("Wayland does repaint partially. Skipping test."); + } QCOMPARE(topLevel.paintedRegion, expectedUpdateRegion); } |