[gimp] app/tests: Make test that closes dock window use multi-column variant



commit 7b8352bfa04f24e2501b365ac7509cc52df55720
Author: Martin Nordholts <martinn src gnome org>
Date:   Sun Mar 7 09:00:08 2010 +0100

    app/tests: Make test that closes dock window use multi-column variant
    
    Make test that closes dock window use multi-column variant so it
    catches a bunch of warnings that occurs when closing multi-column dock
    windows.

 app/tests/test-ui.c |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/app/tests/test-ui.c b/app/tests/test-ui.c
index c6d0d44..435395b 100644
--- a/app/tests/test-ui.c
+++ b/app/tests/test-ui.c
@@ -85,6 +85,7 @@ static void            gimp_ui_synthesize_delete_event          (GtkWidget
 static GtkWidget     * gimp_ui_find_dock_window                 (GimpDialogFactory *dialog_factory,
                                                                  GimpUiTestFunc     predicate);
 static gboolean        gimp_ui_not_toolbox_window               (GObject           *object);
+static gboolean        gimp_ui_multicolumn_not_toolbox_window   (GObject           *object);
 
 
 int main(int argc, char **argv)
@@ -117,7 +118,7 @@ int main(int argc, char **argv)
               NULL,
               gimp_ui_create_new_image_via_dialog,
               NULL);
-  g_test_add ("/gimp-ui/restore-recently-closed-dock",
+  g_test_add ("/gimp-ui/restore-recently-closed-multi-column-dock",
               GimpTestFixture,
               gimp,
               NULL,
@@ -275,7 +276,7 @@ gimp_ui_restore_recently_closed_dock (GimpTestFixture *fixture,
 
   /* Find a non-toolbox dock window */
   dock_window = gimp_ui_find_dock_window (gimp_dialog_factory_get_singleton (),
-                                          gimp_ui_not_toolbox_window);
+                                          gimp_ui_multicolumn_not_toolbox_window);
   g_assert (dock_window != NULL);
 
   /* Count number of docks */
@@ -547,3 +548,12 @@ gimp_ui_not_toolbox_window (GObject *object)
 {
   return ! gimp_dock_window_has_toolbox (GIMP_DOCK_WINDOW (object));
 }
+
+static gboolean
+gimp_ui_multicolumn_not_toolbox_window (GObject *object)
+{
+  GimpDockWindow *dock_window = GIMP_DOCK_WINDOW (object);
+
+  return (! gimp_dock_window_has_toolbox (dock_window) &&
+          g_list_length (gimp_dock_window_get_docks (dock_window)) > 1);
+}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]