summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlli Salli <ollisal@gmail.com>2011-01-01 22:33:36 +0200
committerOlli Salli <ollisal@gmail.com>2011-01-01 22:33:36 +0200
commit063f1028a2ae3e76a4508ca0dcdf6ec697e75df4 (patch)
treefdc06ec4b3c4b422d4afe94fb499fba99c3561a2
parent1c08841fe6b25c6bafe1afa3f9cfc68d6d9ad01f (diff)
TestConnRosterGroups: Wait for synthesized "accept auth request" event so it won't ruin things later
-rw-r--r--tests/dbus/conn-roster-groups.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/dbus/conn-roster-groups.cpp b/tests/dbus/conn-roster-groups.cpp
index 99631361..d4dba219 100644
--- a/tests/dbus/conn-roster-groups.cpp
+++ b/tests/dbus/conn-roster-groups.cpp
@@ -361,6 +361,12 @@ void TestConnRosterGroups::testNotADeathTrap()
QVERIFY(mContact->subscriptionState() != Contact::PresenceStateNo);
+ // Bah... The test CM fails to cancel its "accept auth request" synthesized event even if we
+ // cancel the subscription request, and that event may screw up the rest of the test. So, wait
+ // for the event here.
+ while (mContact->subscriptionState() != Contact::PresenceStateYes)
+ mLoop->processEvents();
+
QVERIFY(connect(mConn->contactManager()->removePresenceSubscription(
QList<ContactPtr>() << mContact,
QLatin1String("Please don't fail")),
@@ -443,6 +449,12 @@ void TestConnRosterGroups::testNotADeathTrap()
QVERIFY(mContact->subscriptionState() != Contact::PresenceStateNo);
+ // Bah... The test CM fails to cancel its "accept auth request" synthesized event even if we
+ // cancel the subscription request, and that event may screw up the rest of the test. So, wait
+ // for the event here.
+ while (mContact->subscriptionState() != Contact::PresenceStateYes)
+ mLoop->processEvents();
+
QVERIFY(connect(mConn->contactManager()->removePresenceSubscription(
QList<ContactPtr>() << mContact,
QLatin1String("Please don't fail")),