Skip to content

Commit

Permalink
macOS: Remove checks for macHasAccessToWindowsServer
Browse files Browse the repository at this point in the history
We do have access to the window server, as reported by the
CGSessionCopyCurrentDictionary() API. As most of our UI tests
do require window server access in some form, let's remove the
existing checks, as they should no longer be needed the way
we run CI these days.

Change-Id: I9ac18bbcc67abf0705c8b4e071dd5f2de0fb5092
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
  • Loading branch information
torarnv committed Oct 2, 2024
1 parent 6f4fcf6 commit 7d6bac5
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 39 deletions.
23 changes: 0 additions & 23 deletions tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,17 +85,6 @@ static HWND winHandleOf(const QWidget *w)
# define Q_CHECK_PAINTEVENTS
#endif

#ifdef Q_OS_MACOS
#include <Security/AuthSession.h>
bool macHasAccessToWindowsServer()
{
SecuritySessionId mySession;
SessionAttributeBits sessionInfo;
SessionGetInfo(callerSecuritySession, &mySession, &sessionInfo);
return (sessionInfo & sessionHasGraphicAccess);
}
#endif

#if defined(Q_OS_WIN)
static inline void setWindowsAnimationsEnabled(bool enabled)
{
Expand Down Expand Up @@ -3563,15 +3552,7 @@ void tst_QWidget::showMinimizedKeepsFocus()

window.showNormal();
QVERIFY(QTest::qWaitForWindowActive(&window));
#ifdef Q_OS_MACOS
if (!macHasAccessToWindowsServer())
QEXPECT_FAIL("", "When not having WindowServer access, we lose focus.", Continue);
#endif
QTRY_COMPARE(window.focusWidget(), firstchild);
#ifdef Q_OS_MACOS
if (!macHasAccessToWindowsServer())
QEXPECT_FAIL("", "When not having WindowServer access, we lose focus.", Continue);
#endif
QTRY_COMPARE(QApplication::focusWidget(), firstchild);
}
}
Expand Down Expand Up @@ -9636,10 +9617,6 @@ void tst_QWidget::doubleRepaint()
QSKIP("QTBUG-52974");
#endif

#if defined(Q_OS_MACOS)
if (!macHasAccessToWindowsServer())
QSKIP("Not having window server access causes the wrong number of repaints to be issues");
#endif
UpdateWidget widget;
widget.setPalette(simplePalette());
widget.setWindowTitle(QLatin1String(QTest::currentTestFunction()));
Expand Down
16 changes: 0 additions & 16 deletions tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -413,18 +413,6 @@ void tst_QMdiArea::subWindowActivated()
}
}

#ifdef Q_OS_MAC
#include <Security/AuthSession.h>
bool macHasAccessToWindowsServer()
{
SecuritySessionId mySession;
SessionAttributeBits sessionInfo;
SessionGetInfo(callerSecuritySession, &mySession, &sessionInfo);
return (sessionInfo & sessionHasGraphicAccess);
}
#endif


void tst_QMdiArea::subWindowActivated2()
{
if (QGuiApplication::platformName().startsWith(QLatin1String("wayland"), Qt::CaseInsensitive))
Expand Down Expand Up @@ -481,10 +469,6 @@ void tst_QMdiArea::subWindowActivated2()
// Check that we only emit _one_ signal and the active window
// is unchanged after showMinimized/showNormal.
mdiArea.showMinimized();
#if defined (Q_OS_MAC)
if (!macHasAccessToWindowsServer())
QEXPECT_FAIL("", "showMinimized doesn't really minimize if you don't have access to the server", Abort);
#endif
#ifdef Q_OS_MAC
QSKIP("QTBUG-25298: This test is unstable on Mac.");
#endif
Expand Down

0 comments on commit 7d6bac5

Please sign in to comment.