[gnome-control-center/wip/benzea/ci: 26/28] tests/network: Add function to find a parent of specific type



commit d3f833544058dd0eba24a4faba1cd566c136465b
Author: Benjamin Berg <bberg redhat com>
Date:   Thu May 24 18:44:11 2018 +0200

    tests/network: Add function to find a parent of specific type
    
    In preparation for testing VPN sorting.

 tests/network/test-network-panel.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
---
diff --git a/tests/network/test-network-panel.c b/tests/network/test-network-panel.c
index f696e6515..13d7eb298 100644
--- a/tests/network/test-network-panel.c
+++ b/tests/network/test-network-panel.c
@@ -119,6 +119,20 @@ fixture_set_up_wired (NetworkPanelFixture  *fixture,
 
 /*****************************************************************************/
 
+static GtkWidget*
+find_parent_of_type(GtkWidget *widget, GType parent)
+{
+  while (widget) {
+    widget = gtk_widget_get_parent (widget);
+    if (G_TYPE_CHECK_INSTANCE_TYPE (G_OBJECT (widget), parent))
+      return widget;
+  }
+
+  return NULL;
+}
+
+/*****************************************************************************/
+
 static void
 test_empty_ui (NetworkPanelFixture  *fixture,
                gconstpointer         user_data)


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