[folks] Prepare the aggregator asynchronously (as clients will)



commit d5fe872c623c0108de9d7afe5282bb224113d786
Author: Travis Reitter <travis reitter collabora co uk>
Date:   Mon Sep 6 13:55:40 2010 -0700

    Prepare the aggregator asynchronously (as clients will)
    
    Helps bgo#629008.

 tests/telepathy/contact-retrieval.vala |   24 +++++++++++++++++++++---
 1 files changed, 21 insertions(+), 3 deletions(-)
---
diff --git a/tests/telepathy/contact-retrieval.vala b/tests/telepathy/contact-retrieval.vala
index f3ff908..9d0a79a 100644
--- a/tests/telepathy/contact-retrieval.vala
+++ b/tests/telepathy/contact-retrieval.vala
@@ -168,17 +168,35 @@ public class ContactRetrievalTests : Folks.TestCase
 
           assert (removed == null);
         });
-      aggregator.prepare ();
 
       /* Kill the main loop after a few seconds. If there are still individuals
-       * in the set of expected individuals, the aggregator has either failed
-       * or been too slow (which we can consider to be failure). */
+       * in the set of expected individuals, the aggregator has either failed or
+       * been too slow (which we can consider to be failure). */
       Timeout.add_seconds (3, () =>
         {
           main_loop.quit ();
           return false;
         });
 
+      Idle.add (() =>
+        {
+          aggregator.prepare.begin ((s,r) =>
+            {
+              try
+                {
+                  aggregator.prepare.end (r);
+                }
+              catch (GLib.Error e1)
+                {
+                  GLib.critical ("failed to prepare aggregator: %s",
+                    e1.message);
+                  assert_not_reached ();
+                }
+            });
+
+          return false;
+        });
+
       main_loop.run ();
 
       /* We should have enumerated exactly the individuals in the set */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]