From 56dd41e5fcadc452ad1c5b0892e3cd0b5fa3da2f Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 9 Jul 2010 10:50:25 -0500 Subject: Delaying the watchers to ensure that we don't dbus activate, and removing the session.conf to even allow for that. --- tests/Makefile.am | 4 ++-- tests/service-version-multiwatch-manager.c | 17 +++++++++++++---- 2 files changed, 15 insertions(+), 6 deletions(-) (limited to 'tests') 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); -- cgit v1.2.3