summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMatt Watson <mattdangerw@gmail.com>2014-01-29 15:15:44 -0800
committerMatt Watson <mattdangerw@gmail.com>2014-01-29 15:29:46 -0800
commit92bdfa0ab268919d04c1fd7d4b3a2523caafb5e4 (patch)
tree4f4ff1ae51d3c6b684a26e6daa25b76b74139f23 /test
parent4f5505f7030b568c96978e28b5019c44cce949b4 (diff)
Show our internal widgets in eos-window
Users should not have be forced to call show all on the toplevel. Calling show on all the widgets they create should be enough to make things show on screen. Which means we need to call show on our internals ourselves. Added a test for this. Calls show on the window so will actually make something pop on screen for a second. But so do other test we have so I think thats OK [endlessm/eos-sdk#535]
Diffstat (limited to 'test')
-rw-r--r--test/endless/test-window.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/endless/test-window.c b/test/endless/test-window.c
index 32639be..3e648d3 100644
--- a/test/endless/test-window.c
+++ b/test/endless/test-window.c
@@ -226,6 +226,25 @@ test_main_area_widgets_visibility (GApplication *app)
gtk_widget_destroy (win);
}
+static void
+test_internal_widget_visibility (GApplication *app) {
+ GtkWidget *win = eos_window_new (EOS_APPLICATION (app));
+ EosPageManager *pm = eos_window_get_page_manager (EOS_WINDOW (win));
+ GtkWidget *page0 = gtk_label_new ("test");
+
+ gtk_container_add (GTK_CONTAINER (pm), page0);
+ gtk_widget_show (page0);
+ gtk_widget_show (win);
+
+ // We have a lot of internal widgets, if we forgotten to call show on one of
+ // them the label won't be visible, even though we just called show on the
+ // two widgets we created in this test.
+ g_assert (gtk_widget_is_visible (page0));
+
+ gtk_widget_destroy (win);
+}
+
+
void
add_window_tests (void)
{
@@ -249,4 +268,6 @@ add_window_tests (void)
ADD_APP_WINDOW_TEST ("/window/prop-page-manager", test_prop_page_manager);
ADD_APP_WINDOW_TEST ("/window/main-area-widgets-visibility",
test_main_area_widgets_visibility);
+ ADD_APP_WINDOW_TEST ("/window/internal-widget-visibility",
+ test_internal_widget_visibility);
}