From 499b4991f4a88afa85dd8803dbf8346182023b25 Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Fri, 2 Mar 2018 15:28:24 +0100 Subject: Make platform checks for Wayland more readable And make it easier to fix if platformName == wayland-egl etc. Change-Id: Ia2d62ba003796e08f3e8a5bbfd0c3fd9d185e4e0 Reviewed-by: Pier Luigi Fiorini Reviewed-by: Shawn Rutledge --- tests/auto/gui/kernel/qwindow/tst_qwindow.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'tests/auto/gui') diff --git a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp index f4097e36ff..339335b3a7 100644 --- a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp +++ b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp @@ -466,6 +466,11 @@ static QString msgRectMismatch(const QRect &r1, const QRect &r2) return result; } +static bool isPlatformWayland() +{ + return !QGuiApplication::platformName().compare(QLatin1String("wayland"), Qt::CaseInsensitive); +} + void tst_QWindow::positioning() { if (!QGuiApplicationPrivate::platformIntegration()->hasCapability( @@ -473,7 +478,7 @@ void tst_QWindow::positioning() QSKIP("This platform does not support non-fullscreen windows"); } - if (!QGuiApplication::platformName().compare(QLatin1String("wayland"), Qt::CaseInsensitive)) + if (isPlatformWayland()) QSKIP("Wayland: This fails. Figure out why."); // Some platforms enforce minimum widths for windows, which can cause extra resize @@ -779,7 +784,7 @@ void tst_QWindow::isExposed() window.hide(); - if (!QGuiApplication::platformName().compare(QLatin1String("wayland"), Qt::CaseInsensitive)) + if (isPlatformWayland()) QSKIP("Wayland: This is flaky. Figure out why."); QCoreApplication::processEvents(); @@ -1337,7 +1342,7 @@ void tst_QWindow::touchCancelWithTouchToMouse() void tst_QWindow::touchInterruptedByPopup() { - if (!QGuiApplication::platformName().compare(QLatin1String("wayland"), Qt::CaseInsensitive)) + if (isPlatformWayland()) QSKIP("Wayland: This test crashes with xdg-shell unstable v6"); InputTestWindow window; @@ -1834,7 +1839,7 @@ void tst_QWindow::mask() void tst_QWindow::initialSize() { - if (!QGuiApplication::platformName().compare(QLatin1String("wayland"), Qt::CaseInsensitive)) + if (isPlatformWayland()) QSKIP("Wayland: This fails. Figure out why."); QSize defaultSize(0,0); @@ -1907,7 +1912,7 @@ void tst_QWindow::modalDialog() void tst_QWindow::modalDialogClosingOneOfTwoModal() { - if (!QGuiApplication::platformName().compare(QLatin1String("wayland"), Qt::CaseInsensitive)) + if (isPlatformWayland()) QSKIP("Wayland: This fails. Figure out why."); QWindow normalWindow; -- cgit v1.2.3