~ci-train-bot/ubuntu-system-settings/ubuntu-system-settings-ubuntu-zesty-2679

« back to all changes in this revision

Viewing changes to tests/mocks/system-image-dbus/fakesystemimagedbus.h

  • Committer: Ken VanDine
  • Date: 2017-03-15 19:17:14 UTC
  • mto: This revision was merged to the branch mainline in revision 1766.
  • Revision ID: ken.vandine@canonical.com-20170315191714-1appjzosayvmf246
removed more click/updates stuff

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * This file is part of system-settings
3
 
 *
4
 
 * Copyright (C) 2016 Canonical Ltd.
5
 
 *
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.
9
 
 *
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.
14
 
 *
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/>.
17
 
 */
18
 
 
19
 
#ifndef FAKESYSTEMIMAGEDBUS_H
20
 
#define FAKESYSTEMIMAGEDBUS_H
21
 
 
22
 
#include <QObject>
23
 
#include <QVariant>
24
 
#include <QString>
25
 
#include <QDBusConnection>
26
 
#include <QDBusInterface>
27
 
 
28
 
#include <libqtdbusmock/DBusMock.h>
29
 
#include <libqtdbustest/DBusTestRunner.h>
30
 
 
31
 
#define SI_SERVICE "com.canonical.SystemImage"
32
 
#define SI_IFACE "com.canonical.SystemImage"
33
 
#define SI_MAIN_OBJECT "/Service"
34
 
 
35
 
// #define FREEDESKTOP_PROPERTIES_IFACE "org.freedesktop.DBus.Properties"
36
 
 
37
 
using namespace QtDBusTest;
38
 
using namespace QtDBusMock;
39
 
 
40
 
class FakeSystemImageDbus : public QObject
41
 
{
42
 
    Q_OBJECT
43
 
private:
44
 
    DBusTestRunner m_dbusTestRunner;
45
 
    DBusMock m_dbusMock;
46
 
    QDBusInterface *m_siMock;
47
 
    QDBusInterface getInterface(const QString &path, const QString &interface);
48
 
public:
49
 
    explicit FakeSystemImageDbus(const QVariantMap &parameters, QObject *parent = 0);
50
 
    ~FakeSystemImageDbus();
51
 
 
52
 
    const QDBusConnection & dbus() { return m_dbusTestRunner.systemConnection(); }
53
 
 
54
 
Q_SIGNALS:
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);
62
 
};
63
 
 
64
 
#endif // FAKESYSTEMIMAGEDBUS_H