aboutsummaryrefslogtreecommitdiff
path: root/tests/test-libappindicator-fallback-item.c
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-02-23 09:46:26 -0600
committerTed Gould <ted@gould.cx>2010-02-23 09:46:26 -0600
commit8c0532f5eeffa2fa96493a89eb3c0be8e7ac5dbf (patch)
tree436097c273769568963c6ed1fe76b7547d535403 /tests/test-libappindicator-fallback-item.c
parent386128abb4ef32983efd13b1e757459aa34d473b (diff)
parent4589ee89bc4ce73a430ef2b9ee43b7666be301b3 (diff)
downloadlibayatana-appindicator-8c0532f5eeffa2fa96493a89eb3c0be8e7ac5dbf.tar.gz
libayatana-appindicator-8c0532f5eeffa2fa96493a89eb3c0be8e7ac5dbf.tar.bz2
libayatana-appindicator-8c0532f5eeffa2fa96493a89eb3c0be8e7ac5dbf.zip
* Upstream merge
* Fixing automatic updating of menus * Handling the visibility of menus better * Improve testing to be more reliable * Handle null string attention icons
Diffstat (limited to 'tests/test-libappindicator-fallback-item.c')
-rw-r--r--tests/test-libappindicator-fallback-item.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/test-libappindicator-fallback-item.c b/tests/test-libappindicator-fallback-item.c
index 2c6e044..9fd1b45 100644
--- a/tests/test-libappindicator-fallback-item.c
+++ b/tests/test-libappindicator-fallback-item.c
@@ -1,5 +1,7 @@
#include <glib.h>
#include <glib-object.h>
+#include <dbus/dbus-glib.h>
+#include <dbus/dbus-glib-bindings.h>
#include <libappindicator/app-indicator.h>
#define TEST_LIBAPPINDICATOR_FALLBACK_ITEM_TYPE (test_libappindicator_fallback_item_get_type ())
@@ -106,6 +108,27 @@ main (int argc, char ** argv)
{
gtk_init(&argc, &argv);
+ GError * error = NULL;
+ DBusGConnection * session_bus = dbus_g_bus_get(DBUS_BUS_SESSION, &error);
+ if (error != NULL) {
+ g_error("Unable to get session bus: %s", error->message);
+ return 1;
+ }
+
+ DBusGProxy * bus_proxy = dbus_g_proxy_new_for_name(session_bus, DBUS_SERVICE_DBUS, DBUS_PATH_DBUS, DBUS_INTERFACE_DBUS);
+
+ guint nameret = 0;
+
+ if (!org_freedesktop_DBus_request_name(bus_proxy, "org.test", 0, &nameret, NULL)) {
+ 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;
+ }
+
TestLibappindicatorFallbackItem * item = g_object_new(TEST_LIBAPPINDICATOR_FALLBACK_ITEM_TYPE,
"id", "test-id",
"category", "Other",