tests: Add helper to find a parent widget to network test
In preparation for testing VPN sorting. Looks for a parent of a specific type.
This commit is contained in:
parent
d45512d680
commit
12555d62eb
1 changed files with 14 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue