summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJohan Klokkhammer Helsing <johan.helsing@qt.io>2018-03-02 15:24:32 +0100
committerLiang Qi <liang.qi@qt.io>2018-03-06 20:02:22 +0000
commit3eb42abab6c7d1f3a32ca55c972b1d7a4a703658 (patch)
tree98ca5fe5c2a984ad386d3d2d0d7bc791c0bcec11 /tests
parent499b4991f4a88afa85dd8803dbf8346182023b25 (diff)
Check for WindowActivation capability instead of platform
Before running tests that depend on QWindow::requestActivate Gets rid of several Wayland platform checks in tst_QWindow. Change-Id: I7a5e029044a968dfcf87ecbb5105c01d52852d35 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/gui/kernel/qwindow/tst_qwindow.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp
index 339335b3a7..5a87ae6067 100644
--- a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp
+++ b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp
@@ -795,8 +795,8 @@ void tst_QWindow::isExposed()
void tst_QWindow::isActive()
{
- if (!QGuiApplication::platformName().compare(QLatin1String("wayland"), Qt::CaseInsensitive))
- QSKIP("Wayland: This fails. Figure out why.");
+ if (!QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::WindowActivation))
+ QSKIP("QWindow::requestActivate() is not supported.");
Window window;
// Some platforms enforce minimum widths for windows, which can cause extra resize
@@ -1480,8 +1480,8 @@ void tst_QWindow::close()
void tst_QWindow::activateAndClose()
{
- if (!QGuiApplication::platformName().compare(QLatin1String("wayland"), Qt::CaseInsensitive))
- QSKIP("Wayland: This fails. Figure out why.");
+ if (!QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::WindowActivation))
+ QSKIP("QWindow::requestActivate() is not supported.");
for (int i = 0; i < 10; ++i) {
QWindow window;
@@ -1876,8 +1876,8 @@ static bool isPlatformOffscreenOrMinimal()
void tst_QWindow::modalDialog()
{
- if (!QGuiApplication::platformName().compare(QLatin1String("wayland"), Qt::CaseInsensitive))
- QSKIP("Wayland: This fails. Figure out why.");
+ if (!QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::WindowActivation))
+ QSKIP("QWindow::requestActivate() is not supported.");
if (QGuiApplication::platformName() == QLatin1String("cocoa"))
QSKIP("Test fails due to QTBUG-61965, and is slow due to QTBUG-61964");
@@ -1957,8 +1957,8 @@ void tst_QWindow::modalDialogClosingOneOfTwoModal()
void tst_QWindow::modalWithChildWindow()
{
- if (!QGuiApplication::platformName().compare(QLatin1String("wayland"), Qt::CaseInsensitive))
- QSKIP("Wayland: This fails. Figure out why.");
+ if (!QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::WindowActivation))
+ QSKIP("QWindow::requestActivate() is not supported.");
QWindow normalWindow;
normalWindow.setFramePosition(m_availableTopLeft + QPoint(80, 80));
@@ -1991,8 +1991,8 @@ void tst_QWindow::modalWithChildWindow()
void tst_QWindow::modalWindowModallity()
{
- if (!QGuiApplication::platformName().compare(QLatin1String("wayland"), Qt::CaseInsensitive))
- QSKIP("Wayland: This fails. Figure out why.");
+ if (!QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::WindowActivation))
+ QSKIP("QWindow::requestActivate() is not supported.");
QWindow normal_window;
normal_window.setFramePosition(m_availableTopLeft + QPoint(80, 80));
@@ -2037,8 +2037,8 @@ void tst_QWindow::modalWindowPosition()
#ifndef QT_NO_CURSOR
void tst_QWindow::modalWindowEnterEventOnHide_QTBUG35109()
{
- if (!QGuiApplication::platformName().compare(QLatin1String("wayland"), Qt::CaseInsensitive))
- QSKIP("Wayland: QWindow::requestActivate() is not supported");
+ if (!QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::WindowActivation))
+ QSKIP("QWindow::requestActivate() is not supported.");
if (isPlatformOffscreenOrMinimal())
QSKIP("Can't test window focusing on offscreen/minimal");