aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-07-09 10:50:25 -0500
committerTed Gould <ted@gould.cx>2010-07-09 10:50:25 -0500
commit56dd41e5fcadc452ad1c5b0892e3cd0b5fa3da2f (patch)
treeffc69cfd3616b761b36594a00c730bf90463de29 /tests
parent5731c1e07e2c2ca4d192213b3128bc5b7a3339b8 (diff)
downloadlibayatana-indicator-56dd41e5fcadc452ad1c5b0892e3cd0b5fa3da2f.tar.gz
libayatana-indicator-56dd41e5fcadc452ad1c5b0892e3cd0b5fa3da2f.tar.bz2
libayatana-indicator-56dd41e5fcadc452ad1c5b0892e3cd0b5fa3da2f.zip
Delaying the watchers to ensure that we don't dbus activate, and removing the session.conf to even allow for that.
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.am4
-rw-r--r--tests/service-version-multiwatch-manager.c17
2 files changed, 15 insertions, 6 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 7690f10..12d6dc3 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -321,9 +321,9 @@ service_version_multiwatch_manager_LDADD = \
$(LIBINDICATOR_LIBS) \
$(top_builddir)/libindicator/.libs/libindicator.a
-service-version-multiwatch-tester: service-version-multiwatch-manager service-version-good-service session.conf service-version-good.service Makefile.am
+service-version-multiwatch-tester: service-version-multiwatch-manager service-version-good-service Makefile.am
@echo "#!/bin/sh" > $@
- @echo dbus-test-runner --dbus-config $(builddir)/session.conf --task ./service-version-good-service --task-name Service --task ./service-version-multiwatch-manager --task-name Manager1 --task ./service-version-multiwatch-manager --task-name Manager2 >> $@
+ @echo dbus-test-runner --task ./service-version-good-service --task-name Service --task ./service-version-multiwatch-manager --task-name Manager1 --task ./service-version-multiwatch-manager --task-name Manager2 >> $@
@chmod +x $@
TESTS += service-version-multiwatch-tester
diff --git a/tests/service-version-multiwatch-manager.c b/tests/service-version-multiwatch-manager.c
index 7293d43..2edbd73 100644
--- a/tests/service-version-multiwatch-manager.c
+++ b/tests/service-version-multiwatch-manager.c
@@ -5,6 +5,7 @@
static GMainLoop * mainloop = NULL;
static gboolean passed = FALSE;
+static IndicatorServiceManager * goodis = NULL;
gboolean
timeout (gpointer data)
@@ -25,6 +26,17 @@ connection_good (IndicatorServiceManager * sm, gboolean connected, gpointer user
return;
}
+gboolean
+delay_start (gpointer data)
+{
+ goodis = indicator_service_manager_new_version("org.ayatana.version.good", SERVICE_VERSION_GOOD);
+ g_signal_connect(G_OBJECT(goodis), INDICATOR_SERVICE_MANAGER_SIGNAL_CONNECTION_CHANGE, G_CALLBACK(connection_good), NULL);
+
+ g_timeout_add_seconds(1, timeout, NULL);
+
+ return FALSE;
+}
+
int
main (int argc, char ** argv)
{
@@ -32,10 +44,7 @@ main (int argc, char ** argv)
g_log_set_always_fatal(G_LOG_LEVEL_CRITICAL);
g_print("Manager: DBUS_SESSION_BUS_ADDRESS = %s\n", g_getenv("DBUS_SESSION_BUS_ADDRESS"));
- IndicatorServiceManager * goodis = indicator_service_manager_new_version("org.ayatana.version.good", SERVICE_VERSION_GOOD);
- g_signal_connect(G_OBJECT(goodis), INDICATOR_SERVICE_MANAGER_SIGNAL_CONNECTION_CHANGE, G_CALLBACK(connection_good), NULL);
-
- g_timeout_add_seconds(1, timeout, NULL);
+ g_timeout_add(500, delay_start, NULL);
mainloop = g_main_loop_new(NULL, FALSE);
g_main_loop_run(mainloop);