summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2013-11-28 21:56:48 -0500
committerMatthias Clasen <mclasen@redhat.com>2013-11-28 21:56:48 -0500
commit5528a0f408c5fa29e174a9612da9b0dd136be81f (patch)
tree7eadcb49dda8839f0a498c136ddc9bc8f84f209c
parent97a06b42527b3df1724c0bc61f654f651f3055e4 (diff)
downloadglib-5528a0f408c5fa29e174a9612da9b0dd136be81f.tar.gz
glib-5528a0f408c5fa29e174a9612da9b0dd136be81f.tar.bz2
glib-5528a0f408c5fa29e174a9612da9b0dd136be81f.zip
Improve GNotification test coverage
-rw-r--r--gio/tests/gnotification.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/gio/tests/gnotification.c b/gio/tests/gnotification.c
index b224661f0..eaf3d927e 100644
--- a/gio/tests/gnotification.c
+++ b/gio/tests/gnotification.c
@@ -29,6 +29,7 @@ activate_app (GApplication *application,
gpointer user_data)
{
GNotification *notification;
+ GIcon *icon;
notification = g_notification_new ("Test");
@@ -37,6 +38,17 @@ activate_app (GApplication *application,
g_application_withdraw_notification (application, "test1");
g_application_send_notification (application, "test3", notification);
+ icon = g_themed_icon_new ("i-c-o-n");
+ g_notification_set_icon (notification, icon);
+ g_object_unref (icon);
+
+ g_notification_set_body (notification, "body");
+ g_notification_set_urgent (notification, TRUE);
+ g_notification_set_default_action_and_target (notification, "app.action", "i", 42);
+ g_notification_add_button_with_target (notification, "label", "app.action2", "s", "bla");
+
+ g_application_send_notification (application, "test4", notification);
+
g_dbus_connection_flush_sync (g_application_get_dbus_connection (application), NULL, NULL);
g_object_unref (notification);
@@ -68,6 +80,10 @@ notification_received (GNotificationServer *server,
case 2:
g_assert_cmpstr (notification_id, ==, "test3");
+ break;
+
+ case 3:
+ g_assert_cmpstr (notification_id, ==, "test4");
g_notification_server_stop (server);
break;
@@ -145,7 +161,7 @@ basic (void)
g_main_loop_run (loop);
- g_assert_cmpint (received_count, ==, 3);
+ g_assert_cmpint (received_count, ==, 4);
g_assert_cmpint (removed_count, ==, 1);
g_object_unref (server);