summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2020-03-30 19:03:22 -0400
committerMatthias Clasen <mclasen@redhat.com>2020-03-30 20:08:25 -0400
commit96f822434f0b67c97e4be03abf19e84143bd39ef (patch)
treeef53092db41f664eec0de0afe6492fd12461f75d
parentace183f38f030e1795594bda5666bf053f823286 (diff)
downloadgtk+-96f822434f0b67c97e4be03abf19e84143bd39ef.tar.gz
testsuite: Add a builder test for shortcut controllers
-rw-r--r--testsuite/gtk/builder.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/testsuite/gtk/builder.c b/testsuite/gtk/builder.c
index c7178d476d..e2c2fcf992 100644
--- a/testsuite/gtk/builder.c
+++ b/testsuite/gtk/builder.c
@@ -2418,6 +2418,35 @@ test_file_filter (void)
g_object_unref (builder);
}
+static void
+test_shortcuts (void)
+{
+ GtkBuilder *builder;
+ GObject *obj;
+
+ const char buffer[] =
+ "<interface>"
+ " <object class='GtkBox' id='box'>"
+ " <child>"
+ " <object class='GtkShortcutController' id='controller'>"
+ " <property name='scope'>managed</property>"
+ " <child>"
+ " <object class='GtkShortcut'>"
+ " <property name='trigger'>&lt;Control&gt;k</property>"
+ " <property name='action'>activate</property>"
+ " </object>"
+ " </child>"
+ " </object>"
+ " </child>"
+ " </object>"
+ "</interface>";
+
+ builder = builder_new_from_string (buffer, -1, NULL);
+ obj = gtk_builder_get_object (builder, "controller");
+ g_assert (GTK_IS_SHORTCUT_CONTROLLER (obj));
+ g_object_unref (builder);
+}
+
int
main (int argc, char **argv)
{
@@ -2462,6 +2491,7 @@ main (int argc, char **argv)
g_test_add_func ("/Builder/Property Bindings", test_property_bindings);
g_test_add_func ("/Builder/anaconda-signal", test_anaconda_signal);
g_test_add_func ("/Builder/FileFilter", test_file_filter);
+ g_test_add_func ("/Builder/Shortcuts", test_shortcuts);
return g_test_run();
}