blob: 19d7d2f4bb87210f91d684e3d6944805477a61d9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include <QTest>
#include <QTimer>
#include <QGuiApplication>
#include <QWindow>
using namespace Qt::StringLiterals;
class tst_AndroidAppless : public QObject
{
Q_OBJECT
private slots:
void app_data();
void app();
};
#define CREATE_DUMMY_ARGC_ARGV() \
int argc = 1; \
char *argv[] = { const_cast<char *>("tst_android_appless") };
void tst_AndroidAppless::app_data()
{
QTest::addColumn<QString>("displayName");
QTest::addRow("one") << "The first QGuiApplication instance";
QTest::addRow("two") << "The second QGuiApplication instance";
}
void tst_AndroidAppless::app()
{
QFETCH(const QString, displayName);
CREATE_DUMMY_ARGC_ARGV()
QGuiApplication app(argc, argv);
app.setApplicationDisplayName(displayName);
QWindow window;
window.show();
QTimer::singleShot(1000, &app, QGuiApplication::quit);
window.show();
app.exec();
}
#undef CREATE_DUMMY_ARGC_ARGV
QTEST_APPLESS_MAIN(tst_AndroidAppless)
#include "tst_android_appless.moc"
|