diff options
author | Ted Gould <ted@gould.cx> | 2010-02-09 15:15:45 -0600 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2010-02-09 15:15:45 -0600 |
commit | f8f935ea451c7b102a6b83b72c90d73255dac139 (patch) | |
tree | 2648937efb86259b4ce8b018478d954c9faf107f /tests | |
parent | 54060d44446cea023842e2a70ea3aec4857272b7 (diff) | |
download | libdbusmenu-f8f935ea451c7b102a6b83b72c90d73255dac139.tar.gz libdbusmenu-f8f935ea451c7b102a6b83b72c90d73255dac139.tar.bz2 libdbusmenu-f8f935ea451c7b102a6b83b72c90d73255dac139.zip |
Setting this stuff up. Woot.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test-glib-proxy-client.c | 5 | ||||
-rw-r--r-- | tests/test-glib-proxy-server.c | 13 |
2 files changed, 14 insertions, 4 deletions
diff --git a/tests/test-glib-proxy-client.c b/tests/test-glib-proxy-client.c index 434465a..7e3541a 100644 --- a/tests/test-glib-proxy-client.c +++ b/tests/test-glib-proxy-client.c @@ -154,10 +154,7 @@ main (int argc, char ** argv) { g_type_init(); - /* Make sure the server starts up and all that */ - g_usleep(500000); - - DbusmenuClient * client = dbusmenu_client_new(":1.0", "/org/test"); + DbusmenuClient * client = dbusmenu_client_new("test.proxy.first_proxy", "/org/test"); g_signal_connect(G_OBJECT(client), DBUSMENU_CLIENT_SIGNAL_LAYOUT_UPDATED, G_CALLBACK(layout_updated), NULL); death_timer = g_timeout_add_seconds(10, timer_func, client); diff --git a/tests/test-glib-proxy-server.c b/tests/test-glib-proxy-server.c index 091e550..2869bfe 100644 --- a/tests/test-glib-proxy-server.c +++ b/tests/test-glib-proxy-server.c @@ -93,6 +93,19 @@ main (int argc, char ** argv) g_debug("DBus ID: %s", dbus_connection_get_server_id(dbus_g_connection_get_connection(dbus_g_bus_get(DBUS_BUS_SESSION, NULL)))); + DBusGProxy * bus_proxy = dbus_g_proxy_new_for_name(connection, DBUS_SERVICE_DBUS, DBUS_PATH_DBUS, DBUS_INTERFACE_DBUS); + guint nameret = 0; + + if (!org_freedesktop_DBus_request_name(bus_proxy, "test.proxy.server", 0, &nameret, &error)) { + g_error("Unable to call to request name"); + return 1; + } + + if (nameret != DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER) { + g_error("Unable to get name"); + return 1; + } + server = dbusmenu_server_new("/org/test"); timer_func(NULL); |