aboutsummaryrefslogtreecommitdiff
path: root/tests/test-libappindicator-fallback-watcher.c
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-02-22 12:54:25 -0600
committerTed Gould <ted@gould.cx>2010-02-22 12:54:25 -0600
commita067b5b0e1da84a381eb5ca5a426b87680dcc9f7 (patch)
tree7ed70db2d4812ae0e49cd14be9fe952f1b7fd60b /tests/test-libappindicator-fallback-watcher.c
parente5612deb73c41eb427f3e8ab66a675ab9545f5e2 (diff)
downloadayatana-indicator-application-a067b5b0e1da84a381eb5ca5a426b87680dcc9f7.tar.gz
ayatana-indicator-application-a067b5b0e1da84a381eb5ca5a426b87680dcc9f7.tar.bz2
ayatana-indicator-application-a067b5b0e1da84a381eb5ca5a426b87680dcc9f7.zip
Trying to make the test a little more robust by waiting for the other process to register on the bus, and then waiting.
Diffstat (limited to 'tests/test-libappindicator-fallback-watcher.c')
-rw-r--r--tests/test-libappindicator-fallback-watcher.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/tests/test-libappindicator-fallback-watcher.c b/tests/test-libappindicator-fallback-watcher.c
index 90c7db8..c632dff 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,16 @@ 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;
+ while (!has_owner) {
+ org_freedesktop_DBus_name_has_owner(bus_proxy, "org.test", &has_owner, NULL);
+ }
+
+ g_usleep(250000);
+
+ g_debug("Initing");
+
guint nameret = 0;
if (!org_freedesktop_DBus_request_name(bus_proxy, NOTIFICATION_WATCHER_DBUS_ADDR, 0, &nameret, &error)) {