aboutsummaryrefslogtreecommitdiff
path: root/tests/test-libappindicator-fallback-watcher.c
diff options
context:
space:
mode:
authorSebastien Bacher <seb128@ubuntu.com>2010-02-23 17:52:35 +0100
committerSebastien Bacher <seb128@ubuntu.com>2010-02-23 17:52:35 +0100
commitb42f4757077149c0036491a2f84ebddd36186b5c (patch)
tree6b0be3fe66962a1059b76565e740a4dbb2e6c10a /tests/test-libappindicator-fallback-watcher.c
parentd0087bc21f0468fed2fe6d5e048a449ade2c8070 (diff)
parent1d1afe2b470221603dded93ffcb846c6c59fd545 (diff)
downloadayatana-indicator-application-b42f4757077149c0036491a2f84ebddd36186b5c.tar.gz
ayatana-indicator-application-b42f4757077149c0036491a2f84ebddd36186b5c.tar.bz2
ayatana-indicator-application-b42f4757077149c0036491a2f84ebddd36186b5c.zip
releasing version 0.0.13-0ubuntu80.0.13-0ubuntu8
Diffstat (limited to 'tests/test-libappindicator-fallback-watcher.c')
-rw-r--r--tests/test-libappindicator-fallback-watcher.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/tests/test-libappindicator-fallback-watcher.c b/tests/test-libappindicator-fallback-watcher.c
index 90c7db8..70e01d1 100644
--- a/tests/test-libappindicator-fallback-watcher.c
+++ b/tests/test-libappindicator-fallback-watcher.c
@@ -56,10 +56,6 @@ main (int argv, char ** argc)
g_debug("Waiting to init.");
- /* Wait 1/4 a second, which should trigger the fallback */
- g_usleep(250000);
-
- g_debug("Initing");
GError * error = NULL;
DBusGConnection * session_bus = dbus_g_bus_get(DBUS_BUS_SESSION, &error);
@@ -69,6 +65,23 @@ main (int argv, char ** argc)
}
DBusGProxy * bus_proxy = dbus_g_proxy_new_for_name(session_bus, DBUS_SERVICE_DBUS, DBUS_PATH_DBUS, DBUS_INTERFACE_DBUS);
+
+ gboolean has_owner = FALSE;
+ gint owner_count = 0;
+ while (!has_owner && owner_count < 10000) {
+ org_freedesktop_DBus_name_has_owner(bus_proxy, "org.test", &has_owner, NULL);
+ owner_count++;
+ }
+
+ if (owner_count == 10000) {
+ g_error("Unable to get name owner after 10000 tries");
+ return 1;
+ }
+
+ g_usleep(250000);
+
+ g_debug("Initing");
+
guint nameret = 0;
if (!org_freedesktop_DBus_request_name(bus_proxy, NOTIFICATION_WATCHER_DBUS_ADDR, 0, &nameret, &error)) {