[gtk/kill-tree-menu: 35/52] testsuite: Remove menu tests



commit 343677946989e46c0ba6aa8e8f41459cb5f72f35
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu Dec 26 22:59:38 2019 -0500

    testsuite: Remove menu tests
    
    Menus are going away.

 testsuite/a11y/menu.txt                       |  192 ----
 testsuite/a11y/menu.ui                        |  132 ---
 testsuite/a11y/menubutton.ui                  |    6 +-
 testsuite/a11y/menus.txt                      |  133 ---
 testsuite/a11y/menus.ui                       |   89 --
 testsuite/gtk/builder.c                       |  130 ---
 testsuite/gtk/gtkmenu.c                       |  456 --------
 testsuite/gtk/meson.build                     |    1 -
 testsuite/reftests/inherit-and-initial.css    |    7 -
 testsuite/reftests/inherit-and-initial.ref.ui | 1395 -------------------------
 testsuite/reftests/inherit-and-initial.ui     | 1233 ----------------------
 11 files changed, 2 insertions(+), 3772 deletions(-)
---
diff --git a/testsuite/a11y/menubutton.ui b/testsuite/a11y/menubutton.ui
index 576a9c6101..eb7d509d73 100644
--- a/testsuite/a11y/menubutton.ui
+++ b/testsuite/a11y/menubutton.ui
@@ -1,14 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <interface>
   <!-- interface-requires gtk+ 3.0 -->
-  <object class="GtkMenu" id="menu">
+  <object class="GtkPopover" id="menu">
     <property name="visible">True</property>
-    <property name="can_focus">False</property>
     <child>
-      <object class="GtkMenuItem" id="imagemenuitem">
+      <object class="GtkButton" id="button">
         <property name="label" translatable="yes">_New</property>
         <property name="visible">True</property>
-        <property name="can_focus">False</property>
         <property name="use_underline">True</property>
       </object>
     </child>
diff --git a/testsuite/gtk/builder.c b/testsuite/gtk/builder.c
index fc774a9b1c..645f86bb03 100644
--- a/testsuite/gtk/builder.c
+++ b/testsuite/gtk/builder.c
@@ -648,7 +648,6 @@ test_types (void)
     "  <object class=\"GtkImage\" id=\"image\"/>"
     "  <object class=\"GtkLabel\" id=\"label\"/>"
     "  <object class=\"GtkListStore\" id=\"liststore\"/>"
-    "  <object class=\"GtkMenuBar\" id=\"menubar\"/>"
     "  <object class=\"GtkNotebook\" id=\"notebook\"/>"
     "  <object class=\"GtkProgressBar\" id=\"progressbar\"/>"
     "  <object class=\"GtkRadioButton\" id=\"radiobutton\"/>"
@@ -1990,134 +1989,6 @@ test_add_objects (void)
   g_object_unref (builder);
 }
 
-static GtkWidget *
-get_parent_menubar (GtkWidget *menuitem)
-{
-  GtkMenuShell *menu_shell;
-  GtkWidget *attach = NULL;
-
-  menu_shell = GTK_MENU_SHELL (gtk_widget_get_ancestor (menuitem, GTK_TYPE_MENU_SHELL));
-
-  g_assert (GTK_IS_MENU_SHELL (menu_shell));
-
-  while (menu_shell && !GTK_IS_MENU_BAR (menu_shell))
-    {
-      if (GTK_IS_MENU (menu_shell) && 
-         (attach = gtk_menu_get_attach_widget (GTK_MENU (menu_shell))) != NULL)
-       menu_shell = GTK_MENU_SHELL (gtk_widget_get_ancestor (attach, GTK_TYPE_MENU_SHELL));
-      else
-       menu_shell = NULL;
-    }
-
-  return menu_shell ? GTK_WIDGET (menu_shell) : NULL;
-}
-
-static void
-test_menus (void)
-{
-  const gchar *buffer =
-    "<interface>"
-    "  <object class=\"GtkWindow\" id=\"window1\">"
-    "    <accel-groups>"
-    "      <group name=\"accelgroup1\"/>"
-    "    </accel-groups>"
-    "    <child>"
-    "      <object class=\"GtkBox\" id=\"vbox1\">"
-    "        <property name=\"visible\">True</property>"
-    "        <property name=\"orientation\">vertical</property>"
-    "        <child>"
-    "          <object class=\"GtkMenuBar\" id=\"menubar1\">"
-    "            <property name=\"visible\">True</property>"
-    "            <child>"
-    "              <object class=\"GtkMenuItem\" id=\"menuitem1\">"
-    "                <property name=\"visible\">True</property>"
-    "                <property name=\"label\" translatable=\"yes\">_File</property>"
-    "                <property name=\"use_underline\">True</property>"
-    "                <child type=\"submenu\">"
-    "                  <object class=\"GtkMenu\" id=\"menu1\">"
-    "                    <property name=\"visible\">True</property>"
-    "                    <child>"
-    "                      <object class=\"GtkMenuItem\" id=\"imagemenuitem1\">"
-    "                        <property name=\"label\">gtk-new</property>"
-    "                        <property name=\"visible\">True</property>"
-    "                      </object>"
-    "                    </child>"
-    "                  </object>"
-    "                </child>"
-    "              </object>"
-    "            </child>"
-    "          </object>"
-    "        </child>"
-    "      </object>"
-    "    </child>"
-    "  </object>"
-    "<object class=\"GtkAccelGroup\" id=\"accelgroup1\"/>"
-    "</interface>";
-
-  const gchar *buffer1 =
-    "<interface>"
-    "  <object class=\"GtkWindow\" id=\"window1\">"
-    "    <accel-groups>"
-    "      <group name=\"accelgroup1\"/>"
-    "    </accel-groups>"
-    "    <child>"
-    "      <object class=\"GtkBox\" id=\"vbox1\">"
-    "        <property name=\"visible\">True</property>"
-    "        <property name=\"orientation\">vertical</property>"
-    "        <child>"
-    "          <object class=\"GtkMenuBar\" id=\"menubar1\">"
-    "            <property name=\"visible\">True</property>"
-    "            <child>"
-    "              <object class=\"GtkMenuItem\" id=\"imagemenuitem1\">"
-    "                <property name=\"visible\">True</property>"
-    "                <child>"
-    "                  <object class=\"GtkLabel\" id=\"custom1\">"
-    "                    <property name=\"visible\">True</property>"
-    "                    <property name=\"label\">a label</property>"
-    "                  </object>"
-    "                </child>"
-    "              </object>"
-    "            </child>"
-    "          </object>"
-    "        </child>"
-    "      </object>"
-    "    </child>"
-    "  </object>"
-    "<object class=\"GtkAccelGroup\" id=\"accelgroup1\"/>"
-    "</interface>";
-  GtkBuilder *builder;
-  GtkWidget *window, *item;
-  GtkWidget *custom;
-
-  /* Check that the item has the correct accel label string set
-   */
-  builder = builder_new_from_string (buffer, -1, NULL);
-  window = (GtkWidget *)gtk_builder_get_object (builder, "window1");
-  item = (GtkWidget *)gtk_builder_get_object (builder, "imagemenuitem1");
-
-  gtk_widget_show (window);
-
-  /* Check the menu hierarchy worked here  */
-  g_assert (get_parent_menubar (item));
-
-  gtk_widget_destroy (GTK_WIDGET (window));
-  g_object_unref (builder);
-
-
-  /* Check that we can add alien children to menu items via normal
-   * GtkContainer apis.
-   */
-  builder = builder_new_from_string (buffer1, -1, NULL);
-  window = (GtkWidget *)gtk_builder_get_object (builder, "window1");
-  item = (GtkWidget *)gtk_builder_get_object (builder, "imagemenuitem1");
-  custom = (GtkWidget *)gtk_builder_get_object (builder, "custom1");
-
-  g_assert (gtk_widget_get_parent (custom) == item);
-
-  gtk_widget_destroy (GTK_WIDGET (window));
-  g_object_unref (builder);
-}
-
 static void
 test_file (const gchar *filename)
 {
@@ -2683,7 +2554,6 @@ main (int argc, char **argv)
   g_test_add_func ("/Builder/PangoAttributes", test_pango_attributes);
   g_test_add_func ("/Builder/Requires", test_requires);
   g_test_add_func ("/Builder/AddObjects", test_add_objects);
-  g_test_add_func ("/Builder/Menus", test_menus);
   g_test_add_func ("/Builder/MessageArea", test_message_area);
   g_test_add_func ("/Builder/MessageDialog", test_message_dialog);
   g_test_add_func ("/Builder/GMenu", test_gmenu);
diff --git a/testsuite/gtk/meson.build b/testsuite/gtk/meson.build
index b02d3f51ce..2b5db62892 100644
--- a/testsuite/gtk/meson.build
+++ b/testsuite/gtk/meson.build
@@ -34,7 +34,6 @@ tests = [
   ['gestures'],
   ['grid'],
   ['grid-layout'],
-  ['gtkmenu'],
   ['icontheme'],
   ['keyhash', ['../../gtk/gtkkeyhash.c', gtkresources, '../../gtk/gtkprivate.c'], gtk_cargs],
   ['listbox'],


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