diff options
author | Ted Gould <ted@gould.cx> | 2010-02-22 15:25:13 -0600 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2010-02-22 15:25:13 -0600 |
commit | dd2a9a5096d01f6f0f37408ce39fba087cc84dd8 (patch) | |
tree | 1cf17fb7f177fcbe2575f7fb2fc0e5ce61b719bc /tests/test-libappindicator-fallback-watcher.c | |
parent | 386128abb4ef32983efd13b1e757459aa34d473b (diff) | |
parent | 75ccac53fc05f24633c76ac5d956b91a9a6640fb (diff) | |
download | ayatana-indicator-application-dd2a9a5096d01f6f0f37408ce39fba087cc84dd8.tar.gz ayatana-indicator-application-dd2a9a5096d01f6f0f37408ce39fba087cc84dd8.tar.bz2 ayatana-indicator-application-dd2a9a5096d01f6f0f37408ce39fba087cc84dd8.zip |
* Upstream merge
* Menu updates connections
Diffstat (limited to 'tests/test-libappindicator-fallback-watcher.c')
-rw-r--r-- | tests/test-libappindicator-fallback-watcher.c | 21 |
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)) { |