qt5base-lts/tests/auto/other/sessionmanagement_macos/tst_sessionmanagement_macos.mm
Lucie Gérard 05fc3aef53 Use SPDX license identifiers
Replace the current license disclaimer in files by
a SPDX-License-Identifier.
Files that have to be modified by hand are modified.
License files are organized under LICENSES directory.

Task-number: QTBUG-67283
Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-05-16 16:37:38 +02:00

37 lines
856 B
Plaintext

// Copyright (C) 2019 Samuel Gaist <samuel.gaist@idiap.ch>
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include <QTest>
#include <QSignalSpy>
#include <QSessionManager>
#include <AppKit/AppKit.h>
// Q_DECLARE_METATYPE(QSessionManager)
class tst_SessionManagement_macOS : public QObject
{
Q_OBJECT
private slots:
void stopApplication();
};
/*
Test that session handling code is properly called
*/
void tst_SessionManagement_macOS::stopApplication()
{
int argc = 0;
QGuiApplication app(argc, nullptr);
QSignalSpy spy(&app, &QGuiApplication::commitDataRequest);
QTimer::singleShot(1000, []() {
[NSApp terminate:nil];
});
app.exec();
QCOMPARE(spy.count(), 1);
}
QTEST_APPLESS_MAIN(tst_SessionManagement_macOS)
#include "tst_sessionmanagement_macos.moc"