LfbEvent: Add feedback-profile property

This allows to specify the feedback profile to use for
this particular event.
This commit is contained in:
Guido Günther
2020-07-10 09:20:04 +00:00
committed by Guido Gunther
parent 6692d8922b
commit 50aeb79ec9
4 changed files with 82 additions and 4 deletions
+10
View File
@@ -13,6 +13,7 @@ test_lfb_event_props (void)
{
g_autoptr(LfbEvent) event = NULL;
g_autofree gchar *evname = NULL;
g_autofree gchar *profile = NULL;
gint timeout;
g_assert_true (lfb_init (TEST_APP_ID, NULL));
@@ -29,6 +30,15 @@ test_lfb_event_props (void)
g_assert_cmpint (lfb_event_get_end_reason (event), ==, LFB_EVENT_END_REASON_NATURAL);
g_assert_cmpint (lfb_event_get_state (event), ==, LFB_EVENT_STATE_NONE);
g_object_get (event, "feedback-profile", &profile, NULL);
g_assert_null (profile);
g_object_set (event, "feedback-profile", "full", NULL);
g_object_get (event, "feedback-profile", &profile, NULL);
g_assert_cmpstr (profile, ==, "full");
g_free (profile);
profile = lfb_event_get_feedback_profile (event);
g_assert_cmpstr (profile, ==, "full");
lfb_uninit ();
}
+1
View File
@@ -161,6 +161,7 @@ test_lfb_integration_event_async (void)
cmp = NULL;
event10 = lfb_event_new ("test-dummy-10");
lfb_event_set_feedback_profile (event10, "quiet");
success = lfb_event_trigger_feedback (event10, &err);
g_assert_no_error (err);
g_assert_true (success);