diff options
Diffstat (limited to 'test/test-window.c')
-rw-r--r-- | test/test-window.c | 31 |
1 files changed, 26 insertions, 5 deletions
diff --git a/test/test-window.c b/test/test-window.c index cf854b1..1ca81ea 100644 --- a/test/test-window.c +++ b/test/test-window.c @@ -99,7 +99,7 @@ test_has_top_bar (GApplication *app) gtk_widget_destroy (win); } -/* Query all the children of win, including the internal children, to find the +/* Query all the children of overlay, including the internal children, to find the main area */ static void find_main_area (GtkWidget *widget, @@ -109,15 +109,36 @@ find_main_area (GtkWidget *widget, *main_area_return_location = widget; } +/* Query all the children of win, including the internal children, to find the +gtk overlay */ static void -test_has_main_area (GApplication *app) +find_overlay (GtkWidget *widget, + GtkWidget **overlay_return_location) { - GtkWidget *win = eos_window_new (EOS_APPLICATION (app)); + if (GTK_IS_OVERLAY (widget)) + *overlay_return_location = widget; +} + +static GtkWidget * +get_main_area (GtkWidget *window) +{ + GtkWidget *overlay = NULL; GtkWidget *main_area = NULL; - gtk_container_forall (GTK_CONTAINER (win), (GtkCallback)find_main_area, + gtk_container_forall (GTK_CONTAINER (window), (GtkCallback)find_overlay, + &overlay); + g_assert (overlay != NULL); + gtk_container_forall (GTK_CONTAINER (overlay), (GtkCallback)find_main_area, &main_area); g_assert (main_area != NULL); + return main_area; +} + +static void +test_has_main_area (GApplication *app) +{ + GtkWidget *win = eos_window_new (EOS_APPLICATION (app)); + GtkWidget *main_area = get_main_area (win); g_assert (EOS_IS_MAIN_AREA (main_area)); gtk_widget_destroy (win); @@ -176,7 +197,7 @@ test_main_area_widgets_visibility (GApplication *app) { GtkWidget *win = eos_window_new (EOS_APPLICATION (app)); EosPageManager *pm = eos_window_get_page_manager (EOS_WINDOW (win)); - GtkWidget *main_area = NULL; + GtkWidget *main_area = get_main_area (win); gtk_container_forall (GTK_CONTAINER (win), (GtkCallback)find_main_area, &main_area); |