aboutsummaryrefslogtreecommitdiff
path: root/tests/test-json-client.c
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2012-03-29 11:34:08 -0700
committerCharles Kerr <charles.kerr@canonical.com>2012-03-29 11:34:08 -0700
commite58eb9f420b0ea6b4830f78027dfddc5a28ec46d (patch)
tree2b364913f9e73bd88da7f507c4658072e68d1996 /tests/test-json-client.c
parent73a2c824dc830cef9577f0993e83bd699fa60362 (diff)
parentbc392e208fa1f9b46c77ea8142dadd629722663a (diff)
downloadlibdbusmenu-e58eb9f420b0ea6b4830f78027dfddc5a28ec46d.tar.gz
libdbusmenu-e58eb9f420b0ea6b4830f78027dfddc5a28ec46d.tar.bz2
libdbusmenu-e58eb9f420b0ea6b4830f78027dfddc5a28ec46d.zip
* New upstream release.
* Faster menuitem lookups (LP: #801699) * To reduce dbus traffic, only send event replies when the caller requests them * Added support for callgrind-based benchmarks * Minor code cleanup
Diffstat (limited to 'tests/test-json-client.c')
-rw-r--r--tests/test-json-client.c23
1 files changed, 4 insertions, 19 deletions
diff --git a/tests/test-json-client.c b/tests/test-json-client.c
index d4e782b..8900902 100644
--- a/tests/test-json-client.c
+++ b/tests/test-json-client.c
@@ -27,14 +27,6 @@ GMainLoop * mainloop = NULL;
gboolean
timeout_func (gpointer user_data)
{
- g_warning("Timeout without getting name");
- g_main_loop_quit(mainloop);
- return FALSE;
-}
-
-void
-name_appeared (GDBusConnection * connection, const gchar * name, const gchar * owner, gpointer user_data)
-{
char ** argv = (char **)user_data;
g_usleep(500000);
@@ -52,25 +44,18 @@ name_appeared (GDBusConnection * connection, const gchar * name, const gchar * o
g_file_replace_contents(ofile, output, g_utf8_strlen(output, -1), NULL, FALSE, 0, NULL, NULL, NULL);
}
+ g_spawn_command_line_sync("gdbus call --session --dest org.dbusmenu.test --object-path /org/test --method com.canonical.dbusmenu.Event 0 clicked \"<0>\" 0", NULL, NULL, NULL, NULL);
+
g_main_loop_quit(mainloop);
- return;
+ return TRUE;
}
int
main (int argc, char ** argv)
{
g_type_init();
- g_debug("Wait for friends");
-
- g_bus_watch_name(G_BUS_TYPE_SESSION,
- "org.dbusmenu.test",
- G_BUS_NAME_WATCHER_FLAGS_NONE,
- name_appeared,
- NULL,
- argv,
- NULL);
- g_timeout_add_seconds(2, timeout_func, NULL);
+ g_timeout_add_seconds(1, timeout_func, argv);
mainloop = g_main_loop_new(NULL, FALSE);
g_main_loop_run(mainloop);