mirror of
https://github.com/crystalidea/qt6windows7.git
synced 2025-07-05 00:35:27 +08:00
qt 6.5.1 original
This commit is contained in:
@ -0,0 +1,36 @@
|
||||
// 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"
|
Reference in New Issue
Block a user