File indexing completed on 2024-04-14 07:29:46

0001 /*
0002     This file is part of the KDE libraries
0003     SPDX-FileCopyrightText: 2014, 2020 David Faure <faure@kde.org>
0004 
0005     SPDX-License-Identifier: LGPL-2.0-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0006 */
0007 
0008 #ifndef APPLICATIONLAUNCHERJOBTEST_H
0009 #define APPLICATIONLAUNCHERJOBTEST_H
0010 
0011 #include <QObject>
0012 #include <QStringList>
0013 
0014 class ApplicationLauncherJobTest : public QObject
0015 {
0016     Q_OBJECT
0017 
0018 private Q_SLOTS:
0019     void initTestCase();
0020     void cleanupTestCase();
0021 
0022     void startProcess_data();
0023     void startProcess();
0024 
0025     void shouldFailOnNonExecutableDesktopFile_data();
0026     void shouldFailOnNonExecutableDesktopFile();
0027 
0028     void shouldFailOnNonExistingExecutable_data();
0029     void shouldFailOnNonExistingExecutable();
0030 
0031     void shouldFailOnInvalidService();
0032     void shouldFailOnServiceWithNoExec();
0033     void shouldFailOnExecutableWithoutPermissions();
0034 
0035     void showOpenWithDialog_data();
0036     void showOpenWithDialog();
0037 
0038 private:
0039     QString createTempService();
0040     void writeTempServiceDesktopFile(const QString &filePath);
0041 
0042     QStringList m_filesToRemove;
0043     QString m_tempService;
0044 };
0045 
0046 #endif /* APPLICATIONLAUNCHERJOBTEST_H */