From 8a5815d92048f84581cc6802c1689f06c7df24f0 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Wed, 10 Feb 2016 20:49:07 -0600 Subject: in test-notifications we do need one wait() wart after all, because the Snap is building its impl proxies asynchronously and hasn't any public way of notifying when they're built --- tests/test-notification.cpp | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) (limited to 'tests/test-notification.cpp') diff --git a/tests/test-notification.cpp b/tests/test-notification.cpp index a51267f..775d6d5 100644 --- a/tests/test-notification.cpp +++ b/tests/test-notification.cpp @@ -38,17 +38,6 @@ namespace g_main_loop_quit(static_cast(gloop)); return G_SOURCE_REMOVE; } - - void on_dbus_signal(GDBusConnection* /*connection*/, - const gchar* /*sender_name*/, - const gchar* /*object_path*/, - const gchar* /*interface_name*/, - const gchar* /*signal_name*/, - GVariant* /*parameters*/, - gpointer gloop) - { - g_main_loop_quit(static_cast(gloop)); - } } /*** @@ -147,25 +136,13 @@ TEST_F(NotificationFixture,Notification) // set test case properties: other-vibrations flag // (and wait for the PropertiesChanged signal so we know the dbusmock got it) - ASSERT_NAME_OWNED_EVENTUALLY(system_bus, AS_BUSNAME); - const auto subscription_id = g_dbus_connection_signal_subscribe(system_bus, - AS_BUSNAME, - "org.freedesktop.DBus.Properties", - "PropertiesChanged", - nullptr, /* object_path */ - "com.lomiri.touch.AccountsService.Sound", - G_DBUS_SIGNAL_FLAGS_NONE, - on_dbus_signal, - loop, - nullptr /*user_data_free_func*/); dbus_test_dbus_mock_object_update_property(as_mock, as_obj, PROP_OTHER_VIBRATIONS, g_variant_new_boolean(test_vibes.other_vibrations), &error); g_assert_no_error(error); - g_main_loop_run(loop); - g_dbus_connection_signal_unsubscribe(system_bus, subscription_id); + wait_msec(100); // run the test (*snap)(test_appt.appt, appt.alarms.front(), func, func); -- cgit v1.2.3