diff options
Diffstat (limited to 'tests/auto/qdbusconnection/tst_qdbusconnection.cpp')
-rw-r--r-- | tests/auto/qdbusconnection/tst_qdbusconnection.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/auto/qdbusconnection/tst_qdbusconnection.cpp b/tests/auto/qdbusconnection/tst_qdbusconnection.cpp index 606659f..5e2f3a9 100644 --- a/tests/auto/qdbusconnection/tst_qdbusconnection.cpp +++ b/tests/auto/qdbusconnection/tst_qdbusconnection.cpp @@ -86,6 +86,7 @@ private slots: void connectToBus(); void connect(); void send(); + void sendWithGui(); void sendAsync(); void sendSignal(); @@ -173,6 +174,22 @@ void tst_QDBusConnection::send() QVERIFY(reply.arguments().at(0).toStringList().contains(con.baseService())); } +void tst_QDBusConnection::sendWithGui() +{ + QDBusConnection con = QDBusConnection::sessionBus(); + + QVERIFY(con.isConnected()); + + QDBusMessage msg = QDBusMessage::createMethodCall("org.freedesktop.DBus", + "/org/freedesktop/DBus", "org.freedesktop.DBus", "ListNames"); + + QDBusMessage reply = con.call(msg, QDBus::BlockWithGui); + + QCOMPARE(reply.arguments().count(), 1); + QCOMPARE(reply.arguments().at(0).typeName(), "QStringList"); + QVERIFY(reply.arguments().at(0).toStringList().contains(con.baseService())); +} + void tst_QDBusConnection::sendAsync() { QDBusConnection con = QDBusConnection::sessionBus(); |