diff --git a/data/org.freedesktop.portal.Notification.xml b/data/org.freedesktop.portal.Notification.xml index 5071c0ad5..9474aa6b1 100644 --- a/data/org.freedesktop.portal.Notification.xml +++ b/data/org.freedesktop.portal.Notification.xml @@ -199,7 +199,7 @@ notification server to treat the button specially. Depending on the ``purpose`` other fields of the button may be ignored. - If the server doesn't understand the ``purpose` it will be + If the server doesn't understand the ``purpose`` it will be ignored and the button will be shown as a normal button. Most standardized hints are defined as part of a ``category``. @@ -208,18 +208,18 @@ The following purposes are defined outside of a ``category``: - * ``system.custom-alert``: + * ``system.custom-alert``: - Not a button in a strict sense. This action may be called, - depending on system policies, automatically by the notification - server whenever the notification is shown. + Not a button in a strict sense. This action may be called, + depending on system policies, automatically by the notification + server whenever the notification is shown. - This allows apps to use custom methods for notifying the user, - for example, to play audio from a special - source like a streaming service or a radio station. + This allows apps to use custom methods for notifying the user, + for example, to play audio from a special + source like a streaming service or a radio station. - No ``label`` should be given when this purpose is used, so that - the server can ignore the button if it doesn't understand the purpose. + No ``label`` should be given when this purpose is used, so that + the server can ignore the button if it doesn't understand the purpose. * ``display-hint`` (``as``) @@ -319,11 +319,11 @@ This type has the following button purposes: - * ``call.hang-up``: + * ``call.hang-up``: - Hang up the ongoing call. + Hang up the ongoing call. - * ``call.enable-speakerphone``: + * ``call.enable-speakerphone``: Enable the speakerphone for the ongoing call. diff --git a/tests/notification.c b/tests/notification.c index c375d8959..57a0ee834 100644 --- a/tests/notification.c +++ b/tests/notification.c @@ -541,20 +541,30 @@ void test_notification_supported_properties (void) { g_autoptr(XdpPortal) portal = NULL; + const char *expected_serialized; g_autoptr(GKeyFile) keyfile = NULL; g_autoptr(GError) error = NULL; g_autofree char *path = NULL; + g_autoptr(GVariant) expected_response = NULL; + g_autoptr(GVariant) response = NULL; keyfile = g_key_file_new (); - g_key_file_set_string (keyfile, "notification", "supported-options", "{ 'something': <'sdfs'> }"); + expected_serialized = "{ 'something': <'sdfs'> }"; + g_key_file_set_string (keyfile, "notification", "supported-options", expected_serialized); path = g_build_filename (outdir, "notification", NULL); g_key_file_save_to_file (keyfile, path, &error); g_assert_no_error (error); + /* Wait for the backend to update the supported options */ + sleep (1); + portal = xdp_portal_new (); - xdp_portal_get_supported_options (portal); + response = xdp_portal_get_supported_notification_options (portal, &error); + g_assert_no_error (error); + expected_response = g_variant_parse (G_VARIANT_TYPE_VARDICT, expected_serialized, NULL, NULL, NULL); + g_assert_true (g_variant_equal (expected_response, response)); } #endif