From b29f86be192fda821b7245b6159fa1aefc623a40 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 14 Jun 2010 13:10:18 -0500 Subject: Adding in a new gtester test suite. --- tests/Makefile.am | 32 ++++++++++++++++++++++- tests/test-gtk-objects.c | 67 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 98 insertions(+), 1 deletion(-) create mode 100644 tests/test-gtk-objects.c (limited to 'tests') diff --git a/tests/Makefile.am b/tests/Makefile.am index cfa1399..6482d09 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -7,6 +7,7 @@ TESTS = \ test-glib-properties \ test-glib-proxy \ test-glib-simple-items \ + test-gtk-objects-test \ test-gtk-label \ test-gtk-reorder @@ -20,6 +21,7 @@ check_PROGRAMS = \ test-glib-proxy-client \ test-glib-proxy-server \ test-glib-proxy-proxy \ + test-gtk-objects \ test-gtk-label-client \ test-gtk-label-server \ test-glib-simple-items \ @@ -196,6 +198,33 @@ test_glib_simple_items_LDADD = \ ../libdbusmenu-glib/libdbusmenu-glib.la \ $(DBUSMENUGLIB_LIBS) +###################### +# Test GTK Object +###################### + +GTK_OBJECT_XML_REPORT = test-gtk-objects.xml + +test-gtk-objects-test: test-gtk-objects Makefile.am + @echo "#!/bin/bash" > $@ + @echo $(XVFB_RUN) >> $@ + @echo $(DBUS_RUNNER) --task gtester --parameter --verbose --parameter -k --parameter -o --parameter $(GTK_OBJECT_XML_REPORT) --parameter ./test-gtk-objects >> $@ + @chmod +x $@ + +test_gtk_objects_SOURCES = \ + test-gtk-objects.c + +test_gtk_objects_CFLAGS = \ + -I $(srcdir)/.. \ + $(DBUSMENUGLIB_CFLAGS) \ + $(DBUSMENUGTK_CFLAGS) \ + -Wall -Werror + +test_gtk_objects_LDADD = \ + ../libdbusmenu-glib/libdbusmenu-glib.la \ + ../libdbusmenu-gtk/libdbusmenu-gtk.la \ + $(DBUSMENUGLIB_LIBS) \ + $(DBUSMENUGTK_LIBS) + ######################### # Test GTK Label ######################### @@ -322,5 +351,6 @@ distclean-local: DISTCLEANFILES = \ $(TESTS) \ - $(OBJECT_XML_REPORT) + $(OBJECT_XML_REPORT) \ + $(GTK_OBJECT_XML_REPORT) diff --git a/tests/test-gtk-objects.c b/tests/test-gtk-objects.c new file mode 100644 index 0000000..561f91e --- /dev/null +++ b/tests/test-gtk-objects.c @@ -0,0 +1,67 @@ +/* +Testing for the various objects just by themselves. + +Copyright 2010 Canonical Ltd. + +Authors: + Ted Gould + +This program is free software: you can redistribute it and/or modify it +under the terms of the GNU General Public License version 3, as published +by the Free Software Foundation. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranties of +MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR +PURPOSE. See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along +with this program. If not, see . +*/ + +#include +#include + +/* Building the basic menu item, make sure we didn't break + any core GObject stuff */ +static void +test_object_menuitem (void) +{ + /* Build a menu item */ + DbusmenuMenuitem * item = dbusmenu_menuitem_new(); + + /* Test to make sure it's a happy object */ + g_assert(item != NULL); + g_assert(G_IS_OBJECT(item)); + g_assert(DBUSMENU_IS_MENUITEM(item)); + + /* Set up a check to make sure it gets destroyed on unref */ + g_object_add_weak_pointer(G_OBJECT(item), (gpointer *)&item); + g_object_unref(item); + + /* Did it go away? */ + g_assert(item == NULL); + + return; +} + +/* Build the test suite */ +static void +test_gtk_objects_suite (void) +{ + g_test_add_func ("/dbusmenu/gtk/objects/menuitem/base", test_object_menuitem); + return; +} + +gint +main (gint argc, gchar * argv[]) +{ + gtk_init(&argc, &argv); + + g_test_init(&argc, &argv, NULL); + + /* Test suites */ + test_gtk_objects_suite(); + + return g_test_run (); +} -- cgit v1.2.3 From c78d1b4b827e13ee4e498516e14a56571e8a8b5f Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 14 Jun 2010 13:29:49 -0500 Subject: Adding a test image --- tests/test-gtk-objects.jpg | Bin 0 -> 14376 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 tests/test-gtk-objects.jpg (limited to 'tests') diff --git a/tests/test-gtk-objects.jpg b/tests/test-gtk-objects.jpg new file mode 100644 index 0000000..478704e Binary files /dev/null and b/tests/test-gtk-objects.jpg differ -- cgit v1.2.3 From ecf64a2f000ee9666a263afe23075d36bf2efe9a Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 14 Jun 2010 13:54:12 -0500 Subject: Adding in a test for the pixbuf property --- tests/Makefile.am | 1 + tests/test-gtk-objects.c | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) (limited to 'tests') diff --git a/tests/Makefile.am b/tests/Makefile.am index 6482d09..b21c346 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -217,6 +217,7 @@ test_gtk_objects_CFLAGS = \ -I $(srcdir)/.. \ $(DBUSMENUGLIB_CFLAGS) \ $(DBUSMENUGTK_CFLAGS) \ + -DSRCDIR="\"$(srcdir)\"" \ -Wall -Werror test_gtk_objects_LDADD = \ diff --git a/tests/test-gtk-objects.c b/tests/test-gtk-objects.c index 561f91e..c9f9c4c 100644 --- a/tests/test-gtk-objects.c +++ b/tests/test-gtk-objects.c @@ -22,6 +22,8 @@ with this program. If not, see . #include #include +#define TEST_IMAGE SRCDIR "/" "test-gtk-objects.jpg" + /* Building the basic menu item, make sure we didn't break any core GObject stuff */ static void @@ -45,11 +47,49 @@ test_object_menuitem (void) return; } +/* Setting and getting a pixbuf */ +static void +test_object_prop_pixbuf (void) +{ + const gchar * prop_name = "image-test"; + + /* Build a menu item */ + DbusmenuMenuitem * item = dbusmenu_menuitem_new(); + + /* Test to make sure it's a happy object */ + g_assert(item != NULL); + g_assert(G_IS_OBJECT(item)); + g_assert(DBUSMENU_IS_MENUITEM(item)); + + /* Load our image */ + GdkPixbuf * pixbuf = gdk_pixbuf_new_from_file(TEST_IMAGE, NULL); + g_assert(pixbuf != NULL); + + /* Set the property */ + gboolean success = dbusmenu_menuitem_property_set_image(item, prop_name, pixbuf); + g_assert(success); + g_object_unref(pixbuf); + + /* Check to see if it's set */ + const GValue * val = dbusmenu_menuitem_property_get_value(item, prop_name); + g_assert(val != NULL); + + /* Get the pixbuf back! */ + GdkPixbuf * newpixbuf = dbusmenu_menuitem_property_get_image(item, prop_name); + g_assert(newpixbuf != NULL); + g_object_unref(newpixbuf); + + g_object_unref(item); + + return; +} + /* Build the test suite */ static void test_gtk_objects_suite (void) { g_test_add_func ("/dbusmenu/gtk/objects/menuitem/base", test_object_menuitem); + g_test_add_func ("/dbusmenu/gtk/objects/menuitem/prop_pixbuf", test_object_prop_pixbuf); return; } -- cgit v1.2.3 From 13fd7c6e7182b3142c6951098dcd2172c9ddf4ca Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 14 Jun 2010 14:09:09 -0500 Subject: Add a test to set the shortcut on a menuitem --- tests/test-gtk-objects.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'tests') diff --git a/tests/test-gtk-objects.c b/tests/test-gtk-objects.c index c9f9c4c..92f2469 100644 --- a/tests/test-gtk-objects.c +++ b/tests/test-gtk-objects.c @@ -21,6 +21,7 @@ with this program. If not, see . #include #include +#include #define TEST_IMAGE SRCDIR "/" "test-gtk-objects.jpg" @@ -84,12 +85,41 @@ test_object_prop_pixbuf (void) return; } +/* Setting and getting a shortcut */ +static void +test_object_prop_shortcut (void) +{ + /* Build a menu item */ + DbusmenuMenuitem * item = dbusmenu_menuitem_new(); + + /* Test to make sure it's a happy object */ + g_assert(item != NULL); + g_assert(G_IS_OBJECT(item)); + g_assert(DBUSMENU_IS_MENUITEM(item)); + + guint key = GDK_c; + GdkModifierType modifier = GDK_CONTROL_MASK; + + /* Set a shortcut */ + gboolean success = dbusmenu_menuitem_property_set_shortcut(item, key, modifier); + g_assert(success); + + /* Check for value */ + const GValue * val = dbusmenu_menuitem_property_get_value(item, DBUSMENU_MENUITEM_PROP_SHORTCUT); + g_assert(val != NULL); + + g_object_unref(item); + + return; +} + /* Build the test suite */ static void test_gtk_objects_suite (void) { g_test_add_func ("/dbusmenu/gtk/objects/menuitem/base", test_object_menuitem); g_test_add_func ("/dbusmenu/gtk/objects/menuitem/prop_pixbuf", test_object_prop_pixbuf); + g_test_add_func ("/dbusmenu/gtk/objects/menuitem/prop_shortcut", test_object_prop_shortcut); return; } -- cgit v1.2.3 From 01b4ed50a28d5e340462b5371802006260519a11 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 14 Jun 2010 14:20:34 -0500 Subject: Putting more sensible names in the gtester output --- tests/Makefile.am | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/Makefile.am b/tests/Makefile.am index b21c346..d608860 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -86,7 +86,7 @@ OBJECT_XML_REPORT = test-glib-objects.xml test-glib-objects-test: test-glib-objects Makefile.am @echo "#!/bin/bash" > $@ - @echo $(DBUS_RUNNER) --task gtester --parameter --verbose --parameter -k --parameter -o --parameter $(OBJECT_XML_REPORT) --parameter ./test-glib-objects >> $@ + @echo $(DBUS_RUNNER) --task gtester --task-name test --parameter --verbose --parameter -k --parameter -o --parameter $(OBJECT_XML_REPORT) --parameter ./test-glib-objects >> $@ @chmod +x $@ test_glib_objects_SOURCES = \ @@ -207,7 +207,7 @@ GTK_OBJECT_XML_REPORT = test-gtk-objects.xml test-gtk-objects-test: test-gtk-objects Makefile.am @echo "#!/bin/bash" > $@ @echo $(XVFB_RUN) >> $@ - @echo $(DBUS_RUNNER) --task gtester --parameter --verbose --parameter -k --parameter -o --parameter $(GTK_OBJECT_XML_REPORT) --parameter ./test-gtk-objects >> $@ + @echo $(DBUS_RUNNER) --task gtester --task-name test --parameter --verbose --parameter -k --parameter -o --parameter $(GTK_OBJECT_XML_REPORT) --parameter ./test-gtk-objects >> $@ @chmod +x $@ test_gtk_objects_SOURCES = \ -- cgit v1.2.3 From ac0a5299c1fe73acb30f34939dfcd6af57c12231 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 14 Jun 2010 14:52:26 -0500 Subject: Testing we can get the modifier back out. --- tests/test-gtk-objects.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tests') diff --git a/tests/test-gtk-objects.c b/tests/test-gtk-objects.c index 92f2469..726f404 100644 --- a/tests/test-gtk-objects.c +++ b/tests/test-gtk-objects.c @@ -108,6 +108,14 @@ test_object_prop_shortcut (void) const GValue * val = dbusmenu_menuitem_property_get_value(item, DBUSMENU_MENUITEM_PROP_SHORTCUT); g_assert(val != NULL); + /* Check to see if we love it */ + guint newkey = 0; + GdkModifierType newmodifier = 0; + dbusmenu_menuitem_property_get_shortcut(item, &newkey, &newmodifier); + + g_assert(key == newkey); + g_assert(newmodifier == modifier); + g_object_unref(item); return; -- cgit v1.2.3 From 53e80ec1652a9519a7e546d7055527eb7b5ad2aa Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 14 Jun 2010 15:00:57 -0500 Subject: Sending the test image along with the other data. --- tests/Makefile.am | 1 + 1 file changed, 1 insertion(+) (limited to 'tests') diff --git a/tests/Makefile.am b/tests/Makefile.am index d608860..00297bd 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -324,6 +324,7 @@ EXTRA_DIST = \ $(examples_DATA) \ run-xvfb.sh \ $(json_DATA) \ + test-gtk-objects.jpg \ dbusmenu-gtk/dbusMenuTest \ dbusmenu-gtk/mago_tests/dbusmenu.xml \ dbusmenu-gtk/mago_tests/dbusmenu.py \ -- cgit v1.2.3 From d1cf581703855139e5759ed2fd7b3c49157061ad Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 14 Jun 2010 21:04:19 -0500 Subject: Building a shortcut test --- tests/Makefile.am | 43 +++++++++++++++++ tests/test-gtk-shortcut-client.c | 75 ++++++++++++++++++++++++++++++ tests/test-gtk-shortcut-server.c | 99 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 217 insertions(+) create mode 100644 tests/test-gtk-shortcut-client.c create mode 100644 tests/test-gtk-shortcut-server.c (limited to 'tests') diff --git a/tests/Makefile.am b/tests/Makefile.am index 00297bd..356146f 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -9,6 +9,7 @@ TESTS = \ test-glib-simple-items \ test-gtk-objects-test \ test-gtk-label \ + test-gtk-shortcut \ test-gtk-reorder check_PROGRAMS = \ @@ -24,6 +25,8 @@ check_PROGRAMS = \ test-gtk-objects \ test-gtk-label-client \ test-gtk-label-server \ + test-gtk-shortcut-client \ + test-gtk-shortcut-server \ test-glib-simple-items \ test-gtk-reorder-server @@ -266,6 +269,46 @@ test_gtk_label_client_LDADD = \ $(DBUSMENUGTK_LIBS) \ $(DBUSMENUTESTS_LIBS) +######################### +# Test GTK Shortcut +######################### + +test-gtk-shortcut: test-gtk-shortcut-client test-gtk-shortcut-server Makefile.am + @echo "#!/bin/bash" > $@ + @echo $(XVFB_RUN) >> $@ + @echo $(DBUS_RUNNER) --task ./test-gtk-shortcut-client --task-name Client --task ./test-gtk-shortcut-server --task-name Server --ignore-return >> $@ + @chmod +x $@ + +test_gtk_shortcut_server_SOURCES = \ + test-gtk-shortcut-server.c + +test_gtk_shortcut_server_CFLAGS = \ + -I $(srcdir)/.. \ + $(DBUSMENUGTK_CFLAGS) \ + $(DBUSMENUTESTS_CFLAGS) \ + $(DBUSMENUGLIB_CFLAGS) -Wall -Werror + +test_gtk_shortcut_server_LDADD = \ + ../libdbusmenu-glib/libdbusmenu-glib.la \ + ../libdbusmenu-gtk/libdbusmenu-gtk.la \ + $(DBUSMENUGTK_LIBS) \ + $(DBUSMENUTESTS_LIBS) + +test_gtk_shortcut_client_SOURCES = \ + test-gtk-shortcut-client.c + +test_gtk_shortcut_client_CFLAGS = \ + -I $(srcdir)/.. \ + $(DBUSMENUGTK_CFLAGS) \ + $(DBUSMENUTESTS_CFLAGS) \ + $(DBUSMENUGLIB_CFLAGS) -Wall -Werror + +test_gtk_shortcut_client_LDADD = \ + ../libdbusmenu-glib/libdbusmenu-glib.la \ + ../libdbusmenu-gtk/libdbusmenu-gtk.la \ + $(DBUSMENUGTK_LIBS) \ + $(DBUSMENUTESTS_LIBS) + ######################### # Test GTK Reorder ######################### diff --git a/tests/test-gtk-shortcut-client.c b/tests/test-gtk-shortcut-client.c new file mode 100644 index 0000000..26e1531 --- /dev/null +++ b/tests/test-gtk-shortcut-client.c @@ -0,0 +1,75 @@ +/* +A test for libdbusmenu to ensure its quality. + +Copyright 2009 Canonical Ltd. + +Authors: + Ted Gould + +This program is free software: you can redistribute it and/or modify it +under the terms of the GNU General Public License version 3, as published +by the Free Software Foundation. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranties of +MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR +PURPOSE. See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along +with this program. If not, see . +*/ + +#include +#include +#include + +static GMainLoop * mainloop = NULL; +static gboolean passed = TRUE; +static guint death_timer = 0; + +static gboolean +timer_func (gpointer data) +{ + passed = TRUE; + g_main_loop_quit(mainloop); + return FALSE; +} + +int +main (int argc, char ** argv) +{ + gtk_init(&argc, &argv); + + g_debug("Building Window"); + GtkWidget * window = gtk_window_new(GTK_WINDOW_TOPLEVEL); + GtkWidget * menubar = gtk_menu_bar_new(); + GtkWidget * menuitem = gtk_menu_item_new_with_label("Test"); + + DbusmenuGtkMenu * dmenu = dbusmenu_gtkmenu_new ("glib.label.test", "/org/test"); + DbusmenuGtkClient * dclient = dbusmenu_gtkmenu_get_client(dmenu); + + GtkAccelGroup * agroup = gtk_accel_group_new(); + dbusmenu_gtkclient_set_accel_group(dclient, agroup); + + gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), GTK_WIDGET(dmenu)); + gtk_widget_show(menuitem); + gtk_menu_bar_append(menubar, menuitem); + gtk_widget_show(menubar); + gtk_container_add(GTK_CONTAINER(window), menubar); + gtk_window_set_title(GTK_WINDOW(window), "libdbusmenu-gtk test"); + gtk_widget_show(window); + + death_timer = g_timeout_add_seconds(10, timer_func, window); + + g_debug("Entering Mainloop"); + mainloop = g_main_loop_new(NULL, FALSE); + g_main_loop_run(mainloop); + + if (passed) { + g_debug("Quiting"); + return 0; + } else { + g_debug("Quiting as we're a failure"); + return 1; + } +} diff --git a/tests/test-gtk-shortcut-server.c b/tests/test-gtk-shortcut-server.c new file mode 100644 index 0000000..428f558 --- /dev/null +++ b/tests/test-gtk-shortcut-server.c @@ -0,0 +1,99 @@ +/* +A test for libdbusmenu to ensure its quality. + +Copyright 2009 Canonical Ltd. + +Authors: + Ted Gould + +This program is free software: you can redistribute it and/or modify it +under the terms of the GNU General Public License version 3, as published +by the Free Software Foundation. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranties of +MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR +PURPOSE. See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along +with this program. If not, see . +*/ + +#include +#include + +#include +#include +#include +#include + +#include +#include +#include + +GMainLoop * mainloop = NULL; +DbusmenuServer * server = NULL; + +gboolean +timer_func (gpointer userdata) +{ + g_main_loop_quit(mainloop); + return FALSE; +} + +void +build_menu (void) +{ + DbusmenuMenuitem * item; + + DbusmenuMenuitem * root = dbusmenu_menuitem_new(); + + item = dbusmenu_menuitem_new(); + dbusmenu_menuitem_property_set(item, DBUSMENU_MENUITEM_PROP_LABEL, "Control-C"); + dbusmenu_menuitem_property_set_shortcut(item, GDK_c, GDK_CONTROL_MASK); + dbusmenu_menuitem_child_append(root, item); + g_object_unref(item); + + + dbusmenu_server_set_root(server, root); + g_object_unref(root); + + return; +} + +int +main (int argc, char ** argv) +{ + GError * error = NULL; + + g_type_init(); + + DBusGConnection * connection = dbus_g_bus_get(DBUS_BUS_SESSION, NULL); + 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, "glib.label.test", 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"); + build_menu(); + + g_timeout_add_seconds(10, timer_func, NULL); + + mainloop = g_main_loop_new(NULL, FALSE); + g_main_loop_run(mainloop); + + g_debug("Quiting"); + + return 0; +} + -- cgit v1.2.3 From 02a8c4e2b1eff14575d1cb78fb35b483f1e35ad7 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 14 Jun 2010 23:57:38 -0500 Subject: More robust comparison --- tests/run-xvfb.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/run-xvfb.sh b/tests/run-xvfb.sh index 3622dbf..3aa05c1 100644 --- a/tests/run-xvfb.sh +++ b/tests/run-xvfb.sh @@ -1,4 +1,4 @@ -if [ "$DISPLAY" == "" ]; then +if [ "x$DISPLAY" == "x" ]; then Xvfb -ac -noreset -screen 0 800x600x16 -help 2>/dev/null 1>&2 XID=`for id in 101 102 103 104 105 106 107 197 199 211 223 227 293 307 308 309 310 311 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 4703 4721 4723 4729 4733 4751 9973 9974 9975 9976 9977 9978 9979 9980 9981 9982 9983 9984 9985 9986 9987 9988 9989 9990 9991 9992 9993 9994 9995 9996 9997 9998 9999 ; do test -e /tmp/.X$id-lock || { echo $id; exit 0; }; done; exit 1` { Xvfb -ac -noreset -screen 0 800x600x16 :$XID -screen 0 800x600x16 -nolisten tcp -auth /dev/null >/dev/null 2>&1 & trap "kill -15 $! " 0 HUP INT QUIT TRAP USR1 PIPE TERM ; } || { echo "Gtk+Tests:ERROR: Failed to start Xvfb environment for X11 target tests."; exit 1; } -- cgit v1.2.3 From fca6f989e2c563ac071322a0f664bdebdcfdf79e Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 15 Jun 2010 14:21:44 -0500 Subject: Making sure the accel group gets added to the window --- tests/test-gtk-shortcut-client.c | 1 + 1 file changed, 1 insertion(+) (limited to 'tests') diff --git a/tests/test-gtk-shortcut-client.c b/tests/test-gtk-shortcut-client.c index 26e1531..003885c 100644 --- a/tests/test-gtk-shortcut-client.c +++ b/tests/test-gtk-shortcut-client.c @@ -57,6 +57,7 @@ main (int argc, char ** argv) gtk_widget_show(menubar); gtk_container_add(GTK_CONTAINER(window), menubar); gtk_window_set_title(GTK_WINDOW(window), "libdbusmenu-gtk test"); + gtk_window_add_accel_group(GTK_WINDOW(window), agroup); gtk_widget_show(window); death_timer = g_timeout_add_seconds(10, timer_func, window); -- cgit v1.2.3 From 607356d413f548b067020bcabed0aa78337066ef Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 15 Jun 2010 14:42:35 -0500 Subject: Switching to control L just in case --- tests/test-gtk-shortcut-server.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/test-gtk-shortcut-server.c b/tests/test-gtk-shortcut-server.c index 428f558..3b703a1 100644 --- a/tests/test-gtk-shortcut-server.c +++ b/tests/test-gtk-shortcut-server.c @@ -49,8 +49,8 @@ build_menu (void) DbusmenuMenuitem * root = dbusmenu_menuitem_new(); item = dbusmenu_menuitem_new(); - dbusmenu_menuitem_property_set(item, DBUSMENU_MENUITEM_PROP_LABEL, "Control-C"); - dbusmenu_menuitem_property_set_shortcut(item, GDK_c, GDK_CONTROL_MASK); + dbusmenu_menuitem_property_set(item, DBUSMENU_MENUITEM_PROP_LABEL, "Control-L"); + dbusmenu_menuitem_property_set_shortcut(item, GDK_l, GDK_CONTROL_MASK); dbusmenu_menuitem_child_append(root, item); g_object_unref(item); -- cgit v1.2.3