[gnome-control-center/wip/benzea/ci: 23/28] tests/network: Add delete_cb



commit 24722d8dd6d65958b9497b8f54a4f234a0dc4bfb
Author: Benjamin Berg <bberg redhat com>
Date:   Thu May 24 18:39:20 2018 +0200

    tests/network: Add delete_cb
    
    Having a delete_cb to handle connection removal is useful for other
    tests. Add the function in preparation for VPN testing.

 tests/network/test-network-panel.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
---
diff --git a/tests/network/test-network-panel.c b/tests/network/test-network-panel.c
index db5d36c72..92a2fb91d 100644
--- a/tests/network/test-network-panel.c
+++ b/tests/network/test-network-panel.c
@@ -222,6 +222,22 @@ add_cb (GObject       *object,
   WAIT_CHECK_REMAINING()
 }
 
+static void
+delete_cb (GObject       *object,
+           GAsyncResult  *result,
+           gpointer       user_data)
+{
+  NMRemoteConnection *connection = NM_REMOTE_CONNECTION (object);
+  EventWaitInfo *info = user_data;
+  g_autoptr(GError) error = NULL;
+
+  nm_remote_connection_delete_finish (connection, result, &error);
+  g_assert_no_error (error);
+
+  info->other_remaining--;
+  WAIT_CHECK_REMAINING()
+}
+
 static void
 test_connection_add (NetworkPanelFixture  *fixture,
                      gconstpointer         user_data)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]