[gtk/gbsneto/shortcuts-rebased: 100/104] testsuite: Remove GtkAccelGroup usage



commit ba41f84f2c96815a57c2d1acae40df0a3d795c6c
Author: Benjamin Otte <otte redhat com>
Date:   Fri Aug 24 07:40:49 2018 +0200

    testsuite: Remove GtkAccelGroup usage

 testsuite/gtk/builder.c                       | 62 ---------------------------
 testsuite/reftests/inherit-and-initial.ref.ui |  4 --
 testsuite/reftests/inherit-and-initial.ui     |  4 --
 3 files changed, 70 deletions(-)
---
diff --git a/testsuite/gtk/builder.c b/testsuite/gtk/builder.c
index 11203cf9a5..1af5f5d616 100644
--- a/testsuite/gtk/builder.c
+++ b/testsuite/gtk/builder.c
@@ -1396,59 +1396,6 @@ test_message_dialog (void)
   g_object_unref (builder);
 }
 
-static void
-test_accelerators (void)
-{
-  GtkBuilder *builder;
-  const gchar *buffer =
-    "<interface>"
-    "  <object class=\"GtkWindow\" id=\"window1\">"
-    "    <child>"
-    "      <object class=\"GtkButton\" id=\"button1\">"
-    "        <accelerator key=\"q\" modifiers=\"GDK_CONTROL_MASK\" signal=\"clicked\"/>"
-    "      </object>"
-    "    </child>"
-    "  </object>"
-    "</interface>";
-  const gchar *buffer2 =
-    "<interface>"
-    "  <object class=\"GtkWindow\" id=\"window1\">"
-    "    <child>"
-    "      <object class=\"GtkTreeView\" id=\"treeview1\">"
-    "        <signal name=\"cursor-changed\" handler=\"gtk_main_quit\"/>"
-    "      </object>"
-    "    </child>"
-    "  </object>"
-    "</interface>";
-  GObject *window1;
-  GSList *accel_groups;
-  GObject *accel_group;
-  
-  builder = builder_new_from_string (buffer, -1, NULL);
-  window1 = gtk_builder_get_object (builder, "window1");
-  g_assert (window1);
-  g_assert (GTK_IS_WINDOW (window1));
-
-  accel_groups = gtk_accel_groups_from_object (window1);
-  g_assert (g_slist_length (accel_groups) == 1);
-  accel_group = g_slist_nth_data (accel_groups, 0);
-  g_assert (accel_group);
-
-  gtk_widget_destroy (GTK_WIDGET (window1));
-  g_object_unref (builder);
-
-  builder = builder_new_from_string (buffer2, -1, NULL);
-  window1 = gtk_builder_get_object (builder, "window1");
-  g_assert (window1);
-  g_assert (GTK_IS_WINDOW (window1));
-
-  accel_groups = gtk_accel_groups_from_object (window1);
-  g_assert_cmpint (g_slist_length (accel_groups), ==, 0);
-
-  gtk_widget_destroy (GTK_WIDGET (window1));
-  g_object_unref (builder);
-}
-
 static void
 test_widget (void)
 {
@@ -2022,9 +1969,6 @@ 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>"
@@ -2055,15 +1999,11 @@ test_menus (void)
     "      </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>"
@@ -2087,7 +2027,6 @@ test_menus (void)
     "      </object>"
     "    </child>"
     "  </object>"
-    "<object class=\"GtkAccelGroup\" id=\"accelgroup1\"/>"
     "</interface>";
   GtkBuilder *builder;
   GtkWidget *window, *item;
@@ -2704,7 +2643,6 @@ main (int argc, char **argv)
 #endif
   g_test_add_func ("/Builder/CellView", test_cell_view);
   g_test_add_func ("/Builder/Dialog", test_dialog);
-  g_test_add_func ("/Builder/Accelerators", test_accelerators);
   g_test_add_func ("/Builder/Widget", test_widget);
   g_test_add_func ("/Builder/Value From String", test_value_from_string);
   g_test_add_func ("/Builder/Reference Counting", test_reference_counting);
diff --git a/testsuite/reftests/inherit-and-initial.ref.ui b/testsuite/reftests/inherit-and-initial.ref.ui
index bf193f0fb1..49c40cee44 100644
--- a/testsuite/reftests/inherit-and-initial.ref.ui
+++ b/testsuite/reftests/inherit-and-initial.ref.ui
@@ -47,7 +47,6 @@ Duis eu lectus quam. Vivamus eget metus a mauris molestie venenatis pulvinar ele
 Nulla facilisi. Pellentesque at dolor sit amet purus dapibus pulvinar molestie quis neque.
 Suspendisse feugiat quam quis dolor accumsan cursus. </property>
   </object>
-  <object class="GtkAccelGroup" id="accelgroup1"/>
   <object class="GtkWindow" id="window">
     <property name="type">popup</property>
     <child>
@@ -1388,8 +1387,5 @@ Suspendisse feugiat quam quis dolor accumsan cursus. </property>
         </child>
       </object>
     </child>
-    <accel-groups>
-      <group name="accelgroup1"/>
-    </accel-groups>
   </object>
 </interface>
diff --git a/testsuite/reftests/inherit-and-initial.ui b/testsuite/reftests/inherit-and-initial.ui
index 9a587ea907..9907a998af 100644
--- a/testsuite/reftests/inherit-and-initial.ui
+++ b/testsuite/reftests/inherit-and-initial.ui
@@ -47,7 +47,6 @@ Duis eu lectus quam. Vivamus eget metus a mauris molestie venenatis pulvinar ele
 Nulla facilisi. Pellentesque at dolor sit amet purus dapibus pulvinar molestie quis neque.
 Suspendisse feugiat quam quis dolor accumsan cursus. </property>
   </object>
-  <object class="GtkAccelGroup" id="accelgroup1"/>
   <object class="GtkWindow" id="window">
     <property name="type">popup</property>
     <child>
@@ -1226,8 +1225,5 @@ Suspendisse feugiat quam quis dolor accumsan cursus. </property>
         </child>
       </object>
     </child>
-    <accel-groups>
-      <group name="accelgroup1"/>
-    </accel-groups>
   </object>
 </interface>


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