summaryrefslogtreecommitdiffstats
path: root/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/gui/kernel/qwindow/tst_qwindow.cpp')
-rw-r--r--tests/auto/gui/kernel/qwindow/tst_qwindow.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp
index 0196c7d72c..4cccf08086 100644
--- a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp
+++ b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp
@@ -1829,6 +1829,12 @@ void tst_QWindow::initialSize()
}
}
+static bool isPlatformOffscreenOrMinimal()
+{
+ return ((QGuiApplication::platformName() == QLatin1String("offscreen"))
+ || (QGuiApplication::platformName() == QLatin1String("minimal")));
+}
+
void tst_QWindow::modalDialog()
{
if (!QGuiApplication::platformName().compare(QLatin1String("wayland"), Qt::CaseInsensitive))
@@ -1853,8 +1859,7 @@ void tst_QWindow::modalDialog()
QGuiApplication::sync();
QGuiApplication::processEvents();
- if (!QGuiApplication::platformName().compare(QLatin1String("offscreen"), Qt::CaseInsensitive)
- || !QGuiApplication::platformName().compare(QLatin1String("minimal"), Qt::CaseInsensitive)) {
+ if (isPlatformOffscreenOrMinimal()) {
QWARN("Focus stays in normalWindow on offscreen/minimal platforms");
QTRY_COMPARE(QGuiApplication::focusWindow(), &normalWindow);
return;
@@ -1899,8 +1904,7 @@ void tst_QWindow::modalDialogClosingOneOfTwoModal()
QGuiApplication::sync();
QGuiApplication::processEvents();
- if (!QGuiApplication::platformName().compare(QLatin1String("offscreen"), Qt::CaseInsensitive)
- || !QGuiApplication::platformName().compare(QLatin1String("minimal"), Qt::CaseInsensitive)) {
+ if (isPlatformOffscreenOrMinimal()) {
QWARN("Focus is lost when closing modal dialog on offscreen/minimal platforms");
QTRY_COMPARE(QGuiApplication::focusWindow(), nullptr);
return;
@@ -1994,6 +1998,9 @@ void tst_QWindow::modalWindowEnterEventOnHide_QTBUG35109()
if (QGuiApplication::platformName() == QLatin1String("cocoa"))
QSKIP("This test fails on OS X on CI");
+ if (isPlatformOffscreenOrMinimal())
+ QSKIP("Can't test window focusing on offscreen/minimal");
+
const QPoint center = QGuiApplication::primaryScreen()->availableGeometry().center();
const int childOffset = 16;