aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2016-02-10 20:49:07 -0600
committerRobert Tari <robert@tari.in>2021-07-01 16:02:09 +0200
commit7bf685ed20be13a94cb66691fddfdc3afedbc2c0 (patch)
tree044ad7a1c6050ef7d2f16aaeb01f271cb8ec371a
parent4d14906702700804b7dffaaf8d9fddcc6d2112d3 (diff)
downloadayatana-indicator-datetime-7bf685ed20be13a94cb66691fddfdc3afedbc2c0.tar.gz
ayatana-indicator-datetime-7bf685ed20be13a94cb66691fddfdc3afedbc2c0.tar.bz2
ayatana-indicator-datetime-7bf685ed20be13a94cb66691fddfdc3afedbc2c0.zip
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
-rw-r--r--tests/test-notification.cpp25
1 files changed, 1 insertions, 24 deletions
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<GMainLoop*>(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<GMainLoop*>(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);