Commit af38078e authored by Alexander Lohnau's avatar Alexander Lohnau 💬 Committed by Aleix Pol Gonzalez
Browse files

libtaskmanager: Fix autotest

The test depends on the applications being installed and the path being
correctly set. To make it more robust the path is set inside of the test
and the files the test used are shipped with it.
parent 2b07e0ce
# SPDX-FileCopyrightText: none
# SPDX-License-Identifier: CC0-1.0
[Desktop Entry]
Name=Dolphin
Exec=dolphin %u
Icon=system-file-manager
Type=Application
X-DocPath=dolphin/index.html
Categories=Qt;KDE;System;FileTools;FileManager;
GenericName=File Manager
Terminal=false
MimeType=inode/directory;
InitialPreference=10
X-DBUS-ServiceName=org.kde.dolphin
StartupWMClass=dolphin
# SPDX-FileCopyrightText: none
# SPDX-License-Identifier: CC0-1.0
[Desktop Entry]
Type=Application
Exec=konversation -qwindowtitle %c %u
Icon=konversation
X-DocPath=konversation/index.html
MimeType=x-scheme-handler/irc;x-scheme-handler/ircs;
GenericName=IRC Client
Terminal=false
Name=Konversation
Categories=Qt;KDE;Network;IRCClient;
X-DBUS-StartupType=Unique
X-DBUS-ServiceName=org.kde.konversation
StartupNotify=true
/********************************************************************
Copyright 2016 Eike Hein <hein@kde.org>
Copyright 2021 Alexander Lohnau <alexander.lohnau@gmx.de>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
......@@ -49,8 +50,10 @@ private:
void LauncherTasksModelTest::initTestCase()
{
qApp->setProperty("org.kde.KActivities.core.disableAutostart", true);
m_urlStrings << QLatin1String("file:///usr/share/applications/org.kde.systemmonitor.desktop");
m_urlStrings << QLatin1String("file:///usr/share/applications/org.kde.konversation.desktop");
m_urlStrings = QStringList{QUrl::fromLocalFile(QFINDTESTDATA("data/applications/org.kde.dolphin.desktop")).toString(),
QUrl::fromLocalFile(QFINDTESTDATA("data/applications/org.kde.konversation.desktop")).toString()};
// We don't want the globally installed apps to interfere and want the test to use our data files
qputenv("XDG_DATA_DIRS", QFINDTESTDATA("data").toLocal8Bit());
}
void LauncherTasksModelTest::shouldRoundTripLauncherUrlList()
......@@ -113,9 +116,8 @@ void LauncherTasksModelTest::shouldRejectDuplicates()
{
LauncherTasksModel m;
QStringList urlStrings;
urlStrings << QLatin1String("file:///usr/share/applications/org.kde.dolphin.desktop");
urlStrings << QLatin1String("file:///usr/share/applications/org.kde.dolphin.desktop");
const QStringList urlStrings = {QUrl::fromLocalFile(QFINDTESTDATA("data/applications/org.kde.dolphin.desktop")).toString(),
QUrl::fromLocalFile(QFINDTESTDATA("data/applications/org.kde.dolphin.desktop")).toString()};
QSignalSpy launcherListChangedSpy(&m, &LauncherTasksModel::launcherListChanged);
QVERIFY(launcherListChangedSpy.isValid());
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment