File indexing completed on 2024-04-14 03:52:46

0001 /*
0002     This file is part of the KDE libraries
0003     SPDX-FileCopyrightText: 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 OPENURLJOBTEST_H
0009 #define OPENURLJOBTEST_H
0010 
0011 #include <QObject>
0012 #include <QStringList>
0013 #include <QTemporaryDir>
0014 
0015 class OpenUrlJobTest : public QObject
0016 {
0017     Q_OBJECT
0018 
0019 private Q_SLOTS:
0020     void initTestCase();
0021     void cleanupTestCase();
0022     void init();
0023 
0024     void startProcess_data();
0025     void startProcess();
0026 
0027     void noServiceNoHandler();
0028     void invalidUrl();
0029     void refuseRunningLocalBinaries_data();
0030     void refuseRunningLocalBinaries();
0031     void refuseRunningRemoteNativeExecutables_data();
0032     void refuseRunningRemoteNativeExecutables();
0033     void notAuthorized();
0034     void runScript_data();
0035     void runScript();
0036     void runNativeExecutable_data();
0037     void runNativeExecutable();
0038     void openOrExecuteScript_data();
0039     void openOrExecuteScript();
0040     void openOrExecuteDesktop_data();
0041     void openOrExecuteDesktop();
0042     void launchExternalBrowser_data();
0043     void launchExternalBrowser();
0044     void nonExistingFile();
0045 
0046     void httpUrlWithKIO();
0047     void ftpUrlWithKIO();
0048 
0049     void takeOverAfterMimeTypeFound();
0050     void runDesktopFileDirectly();
0051 
0052 private:
0053     void writeApplicationDesktopFile(const QString &filePath, const QByteArray &cmd);
0054 
0055     QStringList m_filesToRemove;
0056     QTemporaryDir m_tempDir;
0057     QString m_fakeService;
0058 };
0059 
0060 #endif /* OPENURLJOBTEST_H */