telepathy-qt: tests: add test for retrieving client types using contact attributes
Dario Freddi
drf at kemper.freedesktop.org
Thu Jul 5 06:06:02 PDT 2012
Module: telepathy-qt
Branch: master
Commit: fe864deae2f4892953bad03cf12c7e0ee40dbd20
URL: http://cgit.freedesktop.org/telepathy/telepathy-qt/commit/?id=fe864deae2f4892953bad03cf12c7e0ee40dbd20
Author: George Kiagiadakis <george.kiagiadakis at collabora.com>
Date: Thu Jul 5 14:05:05 2012 +0300
tests: add test for retrieving client types using contact attributes
---
tests/dbus/contacts-client-types.cpp | 22 ++++++++++++++++++++++
1 files changed, 22 insertions(+), 0 deletions(-)
diff --git a/tests/dbus/contacts-client-types.cpp b/tests/dbus/contacts-client-types.cpp
index 003a87f..5bdc6a8 100644
--- a/tests/dbus/contacts-client-types.cpp
+++ b/tests/dbus/contacts-client-types.cpp
@@ -33,6 +33,7 @@ private Q_SLOTS:
void init();
void testClientTypes();
+ void testClientTypesAttributes();
void cleanup();
void cleanupTestCase();
@@ -153,6 +154,27 @@ void TestContactsClientTypes::testClientTypes()
QCOMPARE(mClientTypes, QStringList() << QLatin1String("web"));
}
+void TestContactsClientTypes::testClientTypesAttributes()
+{
+ ContactManagerPtr contactManager = mConn->client()->contactManager();
+
+ QVERIFY(contactManager->supportedFeatures().contains(Contact::FeatureClientTypes));
+
+ const gchar *clientTypes[] = { "pc", "phone", NULL };
+ tp_tests_contacts_connection_change_client_types(TP_TESTS_CONTACTS_CONNECTION(mConn->service()),
+ 2, g_strdupv((gchar**) clientTypes));
+
+ QStringList validIDs = QStringList() << QLatin1String("foo");
+ QList<ContactPtr> contacts = mConn->contacts(validIDs, Contact::FeatureClientTypes);
+ QCOMPARE(contacts.size(), 1);
+
+ ContactPtr contact = contacts[0];
+ QCOMPARE(contact->handle()[0], uint(2));
+ QCOMPARE(contact->requestedFeatures().contains(Contact::FeatureClientTypes), true);
+ QCOMPARE(contact->actualFeatures().contains(Contact::FeatureClientTypes), true);
+ QCOMPARE(contact->clientTypes(), QStringList() << QLatin1String("pc") << QLatin1String("phone"));
+}
+
void TestContactsClientTypes::cleanup()
{
cleanupImpl();
More information about the telepathy-commits
mailing list