From bbb8343a2db5c82809c7c8795e8d66d7d1b03e83 Mon Sep 17 00:00:00 2001 From: Alexander Lohnau Date: Sat, 14 Aug 2021 07:51:01 +0200 Subject: [PATCH] Remove unneeded parts of servies runner test The logic that is tested does not exist in this runner anymore, but it imported in systemsettings. --- .../services/autotests/servicerunnertest.cpp | 53 ------------------- 1 file changed, 53 deletions(-) diff --git a/runners/services/autotests/servicerunnertest.cpp b/runners/services/autotests/servicerunnertest.cpp index 7fe7f6d7e..77b3b605f 100644 --- a/runners/services/autotests/servicerunnertest.cpp +++ b/runners/services/autotests/servicerunnertest.cpp @@ -31,9 +31,7 @@ private Q_SLOTS: void testChromeAppsRelevance(); void testKonsoleVsYakuakeComment(); void testSystemSettings(); - void testForeignAppsOutscoreKCMs(); void testINotifyUsage(); - void testKCMId(); }; void ServiceRunnerTest::initTestCase() @@ -155,42 +153,6 @@ void ServiceRunnerTest::testSystemSettings() QVERIFY(!foreignSystemSettingsFound); } -void ServiceRunnerTest::testForeignAppsOutscoreKCMs() -{ - // Our software outscores other things, but foreign applications should still - // outscore our KCMs. - ServiceRunner runner(this, KPluginMetaData(), QVariantList()); - Plasma::RunnerContext context; - context.setQuery(QStringLiteral("virt")); - - runner.match(context); - - std::optional virtManRelevance; - std::optional virtThingsRelevance; - std::optional kcmRelevance; - const auto matches = context.matches(); - for (const auto &match : matches) { - const QUrl url = match.data().toUrl(); - if (url == QUrl(QStringLiteral("applications:virt-manager.desktop"))) { - virtManRelevance = match.relevance(); - } else if (url == QUrl(QStringLiteral("applications:kcm_kwin_virtualdesktops.desktop"))) { - kcmRelevance = match.relevance(); - } else if (url == QUrl(QStringLiteral("applications:org.kde.virtthings.desktop"))) { - virtThingsRelevance = match.relevance(); - } - } - QVERIFY(virtManRelevance.has_value()); - QVERIFY(virtThingsRelevance.has_value()); - QVERIFY(kcmRelevance.has_value()); - - // KDE app should be >= non-KDE app - QVERIFY2(virtThingsRelevance >= virtManRelevance, qPrintable(QStringLiteral("%1 >= %2").arg(virtThingsRelevance.value(), virtManRelevance.value()))); - // KDE app strictly greater KDE kcm - QVERIFY2(virtThingsRelevance > kcmRelevance, qPrintable(QStringLiteral("%1 > %2").arg(virtThingsRelevance.value(), kcmRelevance.value()))); - // non-KDE app also strictly greater (because it is an app) - QVERIFY2(virtManRelevance > kcmRelevance, qPrintable(QStringLiteral("%1 > %2").arg(virtManRelevance.value(), kcmRelevance.value()))); -} - void ServiceRunnerTest::testINotifyUsage() { auto inotifyCount = []() -> uint { @@ -226,21 +188,6 @@ void ServiceRunnerTest::testINotifyUsage() QVERIFY(inotifyCountCool); } -void ServiceRunnerTest::testKCMId() -{ - ServiceRunner runner(this, KPluginMetaData(), QVariantList()); - Plasma::RunnerContext context; - context.setQuery(QStringLiteral("kcm_kwin_virtualdesktops")); - - runner.match(context); - - const auto matches = context.matches(); - QCOMPARE(matches.count(), 1); - // Ensure KCM ids are uniquely identifying the KCM, not just the host application. - // The specific format of the id is a bit besides the point so we'll only check for our kcm being mentioned. - QVERIFY(matches.at(0).id().contains("kcm_kwin_virtualdesktops")); -} - QTEST_MAIN(ServiceRunnerTest) #include "servicerunnertest.moc"