From 8418f3a96bd138f89e392b2604aabf9bbda3d88a Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 10 Feb 2010 10:37:53 -0600 Subject: Changing to ID based naming and setting a menu to get init --- tests/test-libappindicator-dbus-client.c | 2 +- tests/test-libappindicator-dbus-server.c | 14 ++++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) (limited to 'tests') diff --git a/tests/test-libappindicator-dbus-client.c b/tests/test-libappindicator-dbus-client.c index 5a7107f..6125d36 100644 --- a/tests/test-libappindicator-dbus-client.c +++ b/tests/test-libappindicator-dbus-client.c @@ -200,7 +200,7 @@ main (gint argc, gchar * argv[]) DBusGProxy * props = dbus_g_proxy_new_for_name_owner(session_bus, ":1.0", - "/org/ayatana/NotificationItem", + "/org/ayatana/NotificationItem/my_id", DBUS_INTERFACE_PROPERTIES, &error); if (error != NULL) { diff --git a/tests/test-libappindicator-dbus-server.c b/tests/test-libappindicator-dbus-server.c index cc072aa..76f0e50 100644 --- a/tests/test-libappindicator-dbus-server.c +++ b/tests/test-libappindicator-dbus-server.c @@ -23,7 +23,7 @@ with this program. If not, see . #include #include -#include +#include #include #include "test-defines.h" @@ -39,13 +39,19 @@ kill_func (gpointer userdata) gint main (gint argc, gchar * argv[]) { - g_type_init(); + gtk_init(&argc, &argv); g_debug("DBus ID: %s", dbus_connection_get_server_id(dbus_g_connection_get_connection(dbus_g_bus_get(DBUS_BUS_SESSION, NULL)))); AppIndicator * ci = app_indicator_new (TEST_ID, TEST_ICON_NAME, TEST_CATEGORY); - app_indicator_set_status (ci, TEST_STATE); - app_indicator_set_attention_icon (ci, TEST_ATTENTION_ICON_NAME); + app_indicator_set_status (ci, TEST_STATE); + app_indicator_set_attention_icon (ci, TEST_ATTENTION_ICON_NAME); + + GtkMenu * menu = GTK_MENU(gtk_menu_new()); + GtkMenuItem * item = GTK_MENU_ITEM(gtk_menu_item_new_with_label("Label")); + gtk_menu_shell_append(GTK_MENU_SHELL(menu), GTK_WIDGET(item)); + + app_indicator_set_menu(ci, menu); g_timeout_add_seconds(2, kill_func, NULL); -- cgit v1.2.3 From 6f79c17699cc45ea58491f9da176783264746179 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 10 Feb 2010 10:51:28 -0600 Subject: Building a menu so this item will show --- tests/test-libappindicator-status-server.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/test-libappindicator-status-server.c b/tests/test-libappindicator-status-server.c index 9e58ba9..79b1759 100644 --- a/tests/test-libappindicator-status-server.c +++ b/tests/test-libappindicator-status-server.c @@ -55,7 +55,7 @@ toggle (gpointer userdata) gint main (gint argc, gchar * argv[]) { - g_type_init(); + gtk_init(&argc, &argv); g_usleep(100000); @@ -64,6 +64,12 @@ main (gint argc, gchar * argv[]) AppIndicator * ci = app_indicator_new ("my-id", "my-icon-name", APP_INDICATOR_CATEGORY_APPLICATION_STATUS); app_indicator_set_attention_icon (ci, "my-attention-icon"); + GtkMenu * menu = GTK_MENU(gtk_menu_new()); + GtkMenuItem * item = GTK_MENU_ITEM(gtk_menu_item_new_with_label("Label")); + gtk_menu_shell_append(GTK_MENU_SHELL(menu), GTK_WIDGET(item)); + + app_indicator_set_menu(ci, menu); + g_timeout_add(50, toggle, ci); mainloop = g_main_loop_new(NULL, FALSE); -- cgit v1.2.3 From ec5e7ea86df0da2859bfe4de9d668ce66987d8ab Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 10 Feb 2010 10:53:00 -0600 Subject: Making sure our new tests with gtk_init() in them have an X server to talk to. --- tests/Makefile.am | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/Makefile.am b/tests/Makefile.am index 03e2091..d42ed2b 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -158,14 +158,16 @@ DISTCLEANFILES += $(XML_REPORT) $(HTML_REPORT) libappindicator-tests-gtester DBUS_RUNNER=dbus-test-runner --dbus-config /usr/share/dbus-test-runner/session.conf test-libappindicator-dbus: test-libappindicator-dbus-client test-libappindicator-dbus-server Makefile.am - @echo "#!/bin/sh" > test-libappindicator-dbus + @echo "#!/bin/bash" > test-libappindicator-dbus + @echo . $(srcdir)/run-xvfb.sh >> $@ @echo $(DBUS_RUNNER) --task ./test-libappindicator-dbus-client --task-name Client --task ./test-libappindicator-dbus-server --task-name Server --ignore-return >> test-libappindicator-dbus @chmod +x test-libappindicator-dbus TESTS += test-libappindicator-dbus test-libappindicator-status: test-libappindicator-status-client test-libappindicator-status-server Makefile.am - @echo "#!/bin/sh" > test-libappindicator-status + @echo "#!/bin/bash" > test-libappindicator-status + @echo . $(srcdir)/run-xvfb.sh >> $@ @echo $(DBUS_RUNNER) --task ./test-libappindicator-status-client --task-name Client --task ./test-libappindicator-status-server --task-name Server --ignore-return >> test-libappindicator-status @chmod +x test-libappindicator-status -- cgit v1.2.3