diff options
author | Matt Watson <mattdangerw@gmail.com> | 2013-06-10 19:18:46 -0700 |
---|---|---|
committer | Matt Watson <mattdangerw@gmail.com> | 2013-06-12 12:28:59 -0700 |
commit | f2fb2b414008b362ab11ecec7f76725f7c2d593a (patch) | |
tree | 46a03056b7eea034a4482c03c6044219a7413f4a /test/test-window.c | |
parent | 12ce681e88ac6399a38aa1b3265759466ba133bd (diff) |
Bugfixes. Window background handles case of no pages in pm.
Also updates main area tests in test-window.c to reflect new widget
hierarchy of EosWindow.
[endlessm/eos-sdk#88]
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); |