mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 02:36:34 +01:00
Skip KWallet and GnomeKeyring tests when service not running
This commit is contained in:
parent
0f6720a32c
commit
2cdb0a0b32
@ -1,6 +1,6 @@
|
||||
include($$PWD/../../src/defines.pri)
|
||||
|
||||
QT += webenginewidgets network widgets printsupport sql script testlib
|
||||
QT += webenginewidgets network widgets printsupport sql script dbus testlib
|
||||
|
||||
TARGET = autotests
|
||||
|
||||
|
@ -22,6 +22,8 @@
|
||||
#include <QSqlDatabase>
|
||||
#include <QSqlQuery>
|
||||
#include <QDebug>
|
||||
#include <QDBusMessage>
|
||||
#include <QDBusConnection>
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
#include "qt_windows.h"
|
||||
@ -272,6 +274,20 @@ void DatabaseEncryptedPasswordBackendTest::cleanup()
|
||||
|
||||
#ifdef HAVE_KDE_PASSWORDS_PLUGIN
|
||||
// KWalletPassswordBackendTest
|
||||
void KWalletPassswordBackendTest::init()
|
||||
{
|
||||
QDBusMessage msg = QDBusMessage::createMethodCall(QStringLiteral("org.freedesktop.DBus"),
|
||||
QStringLiteral("/org/freedesktop/DBus"),
|
||||
QStringLiteral("org.freedesktop.DBus"),
|
||||
QStringLiteral("StartServiceByName"));
|
||||
msg << "org.kde.kwalletd5";
|
||||
msg << quint32(0);
|
||||
|
||||
QDBusMessage reply = QDBusConnection::sessionBus().call(msg);
|
||||
if (reply.arguments().isEmpty() || reply.arguments().first().toInt() != 1)
|
||||
QSKIP("This test requires org.kde.kwalletd5 service.");
|
||||
}
|
||||
|
||||
void KWalletPasswordBackendTest::reloadBackend()
|
||||
{
|
||||
delete m_backend;
|
||||
@ -281,6 +297,20 @@ void KWalletPasswordBackendTest::reloadBackend()
|
||||
|
||||
#ifdef HAVE_GNOME_PASSWORDS_PLUGIN
|
||||
// GnomeKeyringPassswordBackendTest
|
||||
void GnomeKeyringPasswordBackendTest::init()
|
||||
{
|
||||
QDBusMessage msg = QDBusMessage::createMethodCall(QStringLiteral("org.freedesktop.DBus"),
|
||||
QStringLiteral("/org/freedesktop/DBus"),
|
||||
QStringLiteral("org.freedesktop.DBus"),
|
||||
QStringLiteral("StartServiceByName"));
|
||||
msg << "org.freedesktop.secrets";
|
||||
msg << quint32(0);
|
||||
|
||||
QDBusMessage reply = QDBusConnection::sessionBus().call(msg);
|
||||
if (reply.arguments().isEmpty() || reply.arguments().first().toInt() != 1)
|
||||
QSKIP("This test requires org.freedesktop.secrets service.");
|
||||
}
|
||||
|
||||
void GnomeKeyringPasswordBackendTest::reloadBackend()
|
||||
{
|
||||
delete m_backend;
|
||||
|
@ -83,6 +83,7 @@ class KWalletPasswordBackendTest : public PasswordBackendTest
|
||||
Q_OBJECT
|
||||
|
||||
protected:
|
||||
void init();
|
||||
void reloadBackend();
|
||||
};
|
||||
#endif
|
||||
@ -95,6 +96,7 @@ class GnomeKeyringPasswordBackendTest : public PasswordBackendTest
|
||||
Q_OBJECT
|
||||
|
||||
protected:
|
||||
void init();
|
||||
void reloadBackend();
|
||||
};
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user