diff options
-rw-r--r-- | tests/Makefile.am | 4 | ||||
-rw-r--r-- | tests/service-version-multiwatch-manager.c | 17 |
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); |