diff options
author | Matt Watson <mattdangerw@gmail.com> | 2014-05-12 18:41:55 -0700 |
---|---|---|
committer | Matt Watson <mattdangerw@gmail.com> | 2014-05-13 12:50:08 -0700 |
commit | b1b7b8a001ab2f50f93c751f025f83ee12fcfac0 (patch) | |
tree | a81bf6d08fd82aed4c83fbcb43787a721bafc444 /test/endless | |
parent | 396bfe04660e17d02c147488edd0c752682afecf (diff) |
Remove splash page manager
Was not getting used in any apps so we are taking it out
[endlessm/eos-sdk#985]
Diffstat (limited to 'test/endless')
-rw-r--r-- | test/endless/Makefile.am.inc | 1 | ||||
-rw-r--r-- | test/endless/run-tests.c | 1 | ||||
-rw-r--r-- | test/endless/run-tests.h | 1 | ||||
-rw-r--r-- | test/endless/test-splash-page-manager.c | 186 |
4 files changed, 0 insertions, 189 deletions
diff --git a/test/endless/Makefile.am.inc b/test/endless/Makefile.am.inc index ac030a3..76a29ec 100644 --- a/test/endless/Makefile.am.inc +++ b/test/endless/Makefile.am.inc @@ -7,7 +7,6 @@ test_endless_run_tests_SOURCES = \ $(ENDLESS_TESTS_DIRECTORY)/endless/test-hello.c \ $(ENDLESS_TESTS_DIRECTORY)/endless/test-application.c \ $(ENDLESS_TESTS_DIRECTORY)/endless/test-page-manager.c \ - $(ENDLESS_TESTS_DIRECTORY)/endless/test-splash-page-manager.c \ $(ENDLESS_TESTS_DIRECTORY)/endless/test-window.c \ $(ENDLESS_TESTS_DIRECTORY)/endless/test-action-menu.c \ $(ENDLESS_TESTS_DIRECTORY)/endless/test-action-button.c \ diff --git a/test/endless/run-tests.c b/test/endless/run-tests.c index 4bc4006..506224b 100644 --- a/test/endless/run-tests.c +++ b/test/endless/run-tests.c @@ -107,7 +107,6 @@ main (int argc, add_application_tests (); add_window_tests (); add_page_manager_tests (); - add_splash_page_manager_tests (); add_action_menu_tests (); add_action_button_tests (); add_flexy_grid_test (); diff --git a/test/endless/run-tests.h b/test/endless/run-tests.h index cb52ab7..b43ef53 100644 --- a/test/endless/run-tests.h +++ b/test/endless/run-tests.h @@ -37,7 +37,6 @@ void add_hello_tests (void); void add_application_tests (void); void add_window_tests (void); void add_page_manager_tests (void); -void add_splash_page_manager_tests (void); void add_action_menu_tests (void); void add_action_button_tests (void); void add_flexy_grid_test (void); diff --git a/test/endless/test-splash-page-manager.c b/test/endless/test-splash-page-manager.c deleted file mode 100644 index 735f872..0000000 --- a/test/endless/test-splash-page-manager.c +++ /dev/null @@ -1,186 +0,0 @@ -#include <gtk/gtk.h> -#include <endless/endless.h> - -#include "run-tests.h" - -#define ADD_SPLASH_PAGE_MANAGER_TEST(path, test_func) \ - g_test_add ((path), SplashPageManagerFixture, NULL, \ - spm_fixture_setup, (test_func), spm_fixture_teardown) -#define ADD_EMPTY_SPLASH_PAGE_MANAGER_TEST(path, test_func) \ - g_test_add ((path), SplashPageManagerFixture, NULL, \ - empty_spm_fixture_setup, (test_func), spm_fixture_teardown); - -typedef struct -{ - GtkWidget *spm; - GtkWidget *first_splash_page; - GtkWidget *second_splash_page; - GtkWidget *first_main_page; - GtkWidget *second_main_page; -} SplashPageManagerFixture; - -static void -empty_spm_fixture_setup (SplashPageManagerFixture *fixture, - gconstpointer unused) -{ - fixture->first_splash_page = gtk_label_new ("splash"); - gtk_widget_show (fixture->first_splash_page); - fixture->second_splash_page = gtk_label_new ("ham sandwich"); - gtk_widget_show (fixture->second_splash_page); - fixture->first_main_page = gtk_label_new ("main"); - gtk_widget_show (fixture->first_main_page); - fixture->second_main_page = gtk_label_new ("pikachu"); - gtk_widget_show (fixture->second_main_page); - fixture->spm = eos_splash_page_manager_new (); - gtk_widget_show (fixture->spm); -} - -static void -spm_fixture_setup (SplashPageManagerFixture *fixture, - gconstpointer unused) -{ - empty_spm_fixture_setup (fixture, unused); - eos_splash_page_manager_set_splash_page (EOS_SPLASH_PAGE_MANAGER (fixture->spm), - fixture->first_splash_page); - eos_splash_page_manager_set_main_page (EOS_SPLASH_PAGE_MANAGER (fixture->spm), - fixture->first_main_page); -} - -static void -spm_fixture_teardown (SplashPageManagerFixture *fixture, - gconstpointer unused) -{ - gtk_widget_destroy (fixture->spm); -} - -static void -test_spm_get_set_splash_page (SplashPageManagerFixture *fixture, - gconstpointer unused) -{ - GtkWidget *splash_page; - splash_page = eos_splash_page_manager_get_splash_page (EOS_SPLASH_PAGE_MANAGER (fixture->spm)); - g_assert (splash_page != fixture->second_splash_page); - eos_splash_page_manager_set_splash_page (EOS_SPLASH_PAGE_MANAGER (fixture->spm), - fixture->second_splash_page); - splash_page = eos_splash_page_manager_get_splash_page (EOS_SPLASH_PAGE_MANAGER (fixture->spm)); - g_assert (splash_page == fixture->second_splash_page); -} - -static void -test_spm_prop_splash_page (SplashPageManagerFixture *fixture, - gconstpointer unused) -{ - GtkWidget *splash_page; - g_object_get (fixture->spm, "splash-page", &splash_page, NULL); - g_assert (splash_page != fixture->second_splash_page); - g_object_set (fixture->spm, "splash-page", fixture->second_splash_page, NULL); - g_object_get (fixture->spm, "splash-page", &splash_page, NULL); - g_assert (splash_page == fixture->second_splash_page); -} - -static void -test_spm_get_set_main_page (SplashPageManagerFixture *fixture, - gconstpointer unused) -{ - GtkWidget *main_page; - main_page = eos_splash_page_manager_get_main_page (EOS_SPLASH_PAGE_MANAGER (fixture->spm)); - g_assert (main_page != fixture->second_main_page); - eos_splash_page_manager_set_main_page (EOS_SPLASH_PAGE_MANAGER (fixture->spm), - fixture->second_main_page); - main_page = eos_splash_page_manager_get_main_page (EOS_SPLASH_PAGE_MANAGER (fixture->spm)); - g_assert (main_page == fixture->second_main_page); -} - -static void -test_spm_prop_main_page (SplashPageManagerFixture *fixture, - gconstpointer unused) -{ - GtkWidget *main_page; - g_object_get (fixture->spm, "main-page", &main_page, NULL); - g_assert (main_page != fixture->second_main_page); - g_object_set (fixture->spm, "main-page", fixture->second_main_page, NULL); - g_object_get (fixture->spm, "main-page", &main_page, NULL); - g_assert (main_page == fixture->second_main_page); -} - -static void -test_spm_show_main_page (SplashPageManagerFixture *fixture, - gconstpointer unused) -{ - GtkWidget *visible_child; - visible_child = gtk_stack_get_visible_child (GTK_STACK (fixture->spm)); - g_assert (visible_child != fixture->first_main_page); - eos_splash_page_manager_show_main_page (EOS_SPLASH_PAGE_MANAGER (fixture->spm)); - visible_child = gtk_stack_get_visible_child (GTK_STACK (fixture->spm)); - g_assert (visible_child == fixture->first_main_page); -} - - -static void -test_spm_show_splash_page (SplashPageManagerFixture *fixture, - gconstpointer unused) -{ - GtkWidget *visible_child; - visible_child = gtk_stack_get_visible_child (GTK_STACK (fixture->spm)); - g_assert (visible_child == fixture->first_splash_page); - eos_splash_page_manager_show_main_page (EOS_SPLASH_PAGE_MANAGER (fixture->spm)); - visible_child = gtk_stack_get_visible_child (GTK_STACK (fixture->spm)); - g_assert (visible_child != fixture->first_splash_page); - eos_splash_page_manager_show_splash_page (EOS_SPLASH_PAGE_MANAGER (fixture->spm)); - visible_child = gtk_stack_get_visible_child (GTK_STACK (fixture->spm)); - g_assert (visible_child == fixture->first_splash_page); -} - -static void -test_spm_default_visible_splash (SplashPageManagerFixture *fixture, - gconstpointer unused) -{ - // Even though main page is added first splash page should be visible after it is added. - GtkWidget *visible_child; - eos_splash_page_manager_set_main_page (EOS_SPLASH_PAGE_MANAGER (fixture->spm), - fixture->first_main_page); - eos_splash_page_manager_set_splash_page (EOS_SPLASH_PAGE_MANAGER (fixture->spm), - fixture->first_splash_page); - visible_child = gtk_stack_get_visible_child (GTK_STACK (fixture->spm)); - g_assert (visible_child == fixture->first_splash_page); -} - -static void -test_spm_add_to_splash (SplashPageManagerFixture *fixture, - gconstpointer unused) -{ - // Right now container add sets the splash page by default. This tests that - // functionality. - GtkWidget *splash_page; - gtk_container_add (GTK_CONTAINER (fixture->spm), - fixture->first_splash_page); - splash_page = eos_splash_page_manager_get_splash_page (EOS_SPLASH_PAGE_MANAGER (fixture->spm)); - g_assert (splash_page == fixture->first_splash_page); -} - -void -add_splash_page_manager_tests (void) -{ - ADD_SPLASH_PAGE_MANAGER_TEST ("/splash-page-manager/show-main-page", - test_spm_show_main_page); - ADD_SPLASH_PAGE_MANAGER_TEST ("/splash-page-manager/show-splash-page", - test_spm_show_splash_page); - ADD_EMPTY_SPLASH_PAGE_MANAGER_TEST ("/splash-page-manager/default-visible-splash", - test_spm_default_visible_splash); - ADD_EMPTY_SPLASH_PAGE_MANAGER_TEST ("/splash-page-manager/add-to-splash", - test_spm_add_to_splash); - - /* Disabled until https://bugzilla.gnome.org/show_bug.cgi?id=699756 is fixed - [endlessm/eos-sdk#67] */ - if (FALSE) - { - ADD_SPLASH_PAGE_MANAGER_TEST ("/splash-page-manager/get-set-splash-page", - test_spm_get_set_splash_page); - ADD_SPLASH_PAGE_MANAGER_TEST ("/splash-page-manager/prop-splash-page", - test_spm_prop_splash_page); - ADD_SPLASH_PAGE_MANAGER_TEST ("/splash-page-manager/get-set-main-page", - test_spm_get_set_main_page); - ADD_SPLASH_PAGE_MANAGER_TEST ("/splash-page-manager/prop-main-page", - test_spm_prop_main_page); - } -} |