From 4083f7e47fe22b887459e3b9c1c401a42483f5d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Wed, 2 Dec 2020 14:17:29 +0100 Subject: [PATCH] testsuite: Remove test for gtk_window_resize() And use gtk_window_set_default_size() in the other place. --- testsuite/gtk/window.c | 66 +----------------------------------------- 1 file changed, 1 insertion(+), 65 deletions(-) diff --git a/testsuite/gtk/window.c b/testsuite/gtk/window.c index 8ffc0645bf..c92c92e03f 100644 --- a/testsuite/gtk/window.c +++ b/testsuite/gtk/window.c @@ -147,69 +147,6 @@ test_default_size (void) gtk_window_destroy (GTK_WINDOW (window)); } -static void -test_resize (void) -{ - GtkWidget *window; - GtkWidget *da; - int w, h; - gboolean done; - - window = gtk_window_new (); - if (interactive) - { - GtkEventController *controller = gtk_event_controller_key_new (); - g_signal_connect (controller, "key-pressed", G_CALLBACK (on_keypress), window); - gtk_widget_add_controller (window, controller); - } - - da = gtk_drawing_area_new (); - gtk_drawing_area_set_draw_func (GTK_DRAWING_AREA (da), on_draw, NULL, NULL); - gtk_window_set_child (GTK_WINDOW (window), da); - - /* test that resize before show overrides default size */ - gtk_window_set_default_size (GTK_WINDOW (window), 500, 500); - - gtk_window_resize (GTK_WINDOW (window), 1, 1); - - gtk_window_get_size (GTK_WINDOW (window), &w, &h); - g_assert_cmpint (w, ==, 1); - g_assert_cmpint (h, ==, 1); - - gtk_window_resize (GTK_WINDOW (window), 400, 200); - - gtk_widget_show (window); - - done = FALSE; - if (!interactive) - g_timeout_add (200, stop_main, &done); - while (!done) - g_main_context_iteration (NULL, TRUE); - - /* test that resize before show works */ - gtk_window_get_size (GTK_WINDOW (window), &w, &h); - g_assert_cmpint (w, ==, 400); - g_assert_cmpint (h, ==, 200); - - /* test that resize after show works, both - * for making things bigger and for making things - * smaller - */ - gtk_window_resize (GTK_WINDOW (window), 200, 400); - - done = FALSE; - if (!interactive) - g_timeout_add (200, stop_main, &done); - while (!done) - g_main_context_iteration (NULL, TRUE); - - gtk_window_get_size (GTK_WINDOW (window), &w, &h); - g_assert_cmpint (w, ==, 200); - g_assert_cmpint (h, ==, 400); - - gtk_window_destroy (GTK_WINDOW (window)); -} - static void test_resize_popup (void) { @@ -220,7 +157,7 @@ test_resize_popup (void) /* testcase for the dnd window */ window = gtk_window_new (); gtk_window_set_decorated (GTK_WINDOW (window), FALSE); - gtk_window_resize (GTK_WINDOW (window), 1, 1); + gtk_window_set_default_size (GTK_WINDOW (window), 1, 1); gtk_window_get_size (GTK_WINDOW (window), &w, &h); g_assert_cmpint (w, ==, 1); g_assert_cmpint (h, ==, 1); @@ -304,7 +241,6 @@ main (int argc, char *argv[]) } g_test_add_func ("/window/default-size", test_default_size); - g_test_add_func ("/window/resize", test_resize); g_test_add_func ("/window/resize-popup", test_resize_popup); g_test_add_func ("/window/show-hide", test_show_hide);