telepathy-qt: set handler info in more dbus tests

David Edmundson davidedmundson at kemper.freedesktop.org
Wed Sep 3 05:52:02 PDT 2014


Module: telepathy-qt
Branch: master
Commit: 7590c3f199703449dad5a0918f22615a960a2a39
URL:    http://cgit.freedesktop.org/telepathy/telepathy-qt/commit/?id=7590c3f199703449dad5a0918f22615a960a2a39

Author: David Edmundson <kde at davidedmundson.co.uk>
Date:   Wed Sep  3 14:41:05 2014 +0200

set handler info in more dbus tests

---

 tests/dbus/client.cpp |   20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)

diff --git a/tests/dbus/client.cpp b/tests/dbus/client.cpp
index 46088ae..758f8ed 100644
--- a/tests/dbus/client.cpp
+++ b/tests/dbus/client.cpp
@@ -387,6 +387,7 @@ private:
     ClientRegistrarPtr mClientRegistrar;
     QString mChannelDispatcherBusName;
     QString mChannelRequestPath;
+    QVariantMap mHandlerInfo;
     ChannelDispatchOperationAdaptor *mCDO;
     QString mCDOPath;
     AbstractClientHandler::Capabilities mClientCapabilities;
@@ -480,7 +481,7 @@ void TestClient::initTestCase()
     QObject *request = new QObject(this);
 
     mUserActionTime = QDateTime::currentDateTime().toTime_t();
-    new ChannelRequestAdaptor(QDBusObjectPath(mAccount->objectPath()),
+    ChannelRequestAdaptor *channelRequest  = new ChannelRequestAdaptor(QDBusObjectPath(mAccount->objectPath()),
             mUserActionTime,
             QString(),
             QualifiedPropertyValueMapList(),
@@ -489,6 +490,18 @@ void TestClient::initTestCase()
     QVERIFY(bus.registerService(mChannelDispatcherBusName));
     QVERIFY(bus.registerObject(mChannelRequestPath, request));
 
+    ObjectImmutablePropertiesMap channelRequestProperties;
+    QVariantMap currentChannelRequestProperties;
+
+    currentChannelRequestProperties.insert(TP_QT_IFACE_CHANNEL_REQUEST + QLatin1String(".Account"), QVariant::fromValue(channelRequest->Account()));
+    currentChannelRequestProperties.insert(TP_QT_IFACE_CHANNEL_REQUEST + QLatin1String(".UserActionTime"), channelRequest->UserActionTime());
+    currentChannelRequestProperties.insert(TP_QT_IFACE_CHANNEL_REQUEST + QLatin1String(".PreferredHandler"), channelRequest->PreferredHandler());
+    currentChannelRequestProperties.insert(TP_QT_IFACE_CHANNEL_REQUEST + QLatin1String(".Requests"), QVariant::fromValue(channelRequest->Requests()));
+    currentChannelRequestProperties.insert(TP_QT_IFACE_CHANNEL_REQUEST + QLatin1String(".Interfaces"), QVariant::fromValue(channelRequest->Interfaces()));
+    channelRequestProperties[QDBusObjectPath(mChannelRequestPath)] = currentChannelRequestProperties;
+
+    mHandlerInfo.insert(QLatin1String("request-properties"), QVariant::fromValue(channelRequestProperties));
+
     // Fake ChannelDispatchOperation
 
     mCDOPath = QLatin1String("/org/freedesktop/Telepathy/ChannelDispatchOperation/Operation1");
@@ -763,12 +776,13 @@ void TestClient::testHandleChannels()
     ChannelDetailsList channelDetailsList;
     ChannelDetails channelDetails = { QDBusObjectPath(mText1ChanPath), QVariantMap() };
     channelDetailsList.append(channelDetails);
+
     handler1Iface->HandleChannels(QDBusObjectPath(mAccount->objectPath()),
             QDBusObjectPath(mConn->objectPath()),
             channelDetailsList,
             ObjectPathList() << QDBusObjectPath(mChannelRequestPath),
             mUserActionTime,
-            QVariantMap());
+            mHandlerInfo);
     QCOMPARE(mLoop->exec(), 0);
 
     QCOMPARE(client1->mHandleChannelsAccount->objectPath(), mAccount->objectPath());
@@ -796,7 +810,7 @@ void TestClient::testHandleChannels()
             channelDetailsList,
             ObjectPathList() << QDBusObjectPath(mChannelRequestPath),
             mUserActionTime,
-            QVariantMap());
+            mHandlerInfo);
     QCOMPARE(mLoop->exec(), 0);
 
     QCOMPARE(client2->mHandleChannelsAccount->objectPath(), mAccount->objectPath());



More information about the telepathy-commits mailing list