2
* This file is part of system-settings
4
* Copyright (C) 2016 Canonical Ltd.
6
* This program is free software: you can redistribute it and/or modify it
7
* under the terms of the GNU General Public License version 3, as published
8
* by the Free Software Foundation.
10
* This program is distributed in the hope that it will be useful, but
11
* WITHOUT ANY WARRANTY; without even the implied warranties of
12
* MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
13
* PURPOSE. See the GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License along
16
* with this program. If not, see <http://www.gnu.org/licenses/>.
19
#ifndef FAKESYSTEMIMAGEDBUS_H
20
#define FAKESYSTEMIMAGEDBUS_H
25
#include <QDBusConnection>
26
#include <QDBusInterface>
28
#include <libqtdbusmock/DBusMock.h>
29
#include <libqtdbustest/DBusTestRunner.h>
31
#define SI_SERVICE "com.canonical.SystemImage"
32
#define SI_IFACE "com.canonical.SystemImage"
33
#define SI_MAIN_OBJECT "/Service"
35
// #define FREEDESKTOP_PROPERTIES_IFACE "org.freedesktop.DBus.Properties"
37
using namespace QtDBusTest;
38
using namespace QtDBusMock;
40
class FakeSystemImageDbus : public QObject
44
DBusTestRunner m_dbusTestRunner;
46
QDBusInterface *m_siMock;
47
QDBusInterface getInterface(const QString &path, const QString &interface);
49
explicit FakeSystemImageDbus(const QVariantMap ¶meters, QObject *parent = 0);
50
~FakeSystemImageDbus();
52
const QDBusConnection & dbus() { return m_dbusTestRunner.systemConnection(); }
55
void mockAvailableStatusChanged(const bool isAvailable,
56
const bool downloading,
57
const QString &availableVersion,
58
const int &updateSize,
59
const QString &lastUpdateDate,
60
const QString &errorReason);
61
void mockSettingChanged(const QString &key, const QString &value);
64
#endif // FAKESYSTEMIMAGEDBUS_H