[gtk+/quartz-integration: 477/563] Add a test for scrolled window child count
- From: John Ralls <jralls src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/quartz-integration: 477/563] Add a test for scrolled window child count
- Date: Sat, 9 Jul 2011 06:46:06 +0000 (UTC)
commit 56995223de84fc4a1aca10ae3ebfa5da1d493476
Author: Matthias Clasen <mclasen redhat com>
Date: Tue Jun 28 23:24:27 2011 -0400
Add a test for scrolled window child count
tests/a11y/Makefile.am | 6 +----
tests/a11y/misc.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 53 insertions(+), 5 deletions(-)
---
diff --git a/tests/a11y/Makefile.am b/tests/a11y/Makefile.am
index e6896b8..e7ef78f 100644
--- a/tests/a11y/Makefile.am
+++ b/tests/a11y/Makefile.am
@@ -23,13 +23,9 @@ accessibility_dump_SOURCES = \
TEST_PROGS += tree-performance
-tree_performance_SOURCES = \
- tree-performance.c
-
TEST_PROGS += text
-text_SOURCES = \
- text.c
+TEST_PROGS += misc
EXTRA_DIST += \
hello-world.ui hello-world.txt \
diff --git a/tests/a11y/misc.c b/tests/a11y/misc.c
new file mode 100644
index 0000000..897914b
--- /dev/null
+++ b/tests/a11y/misc.c
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2011 Red Hat Inc.
+ *
+ * Author:
+ * Matthias Clasen <mclasen redhat com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include <gtk/gtk.h>
+#include <string.h>
+
+static void
+test_scrolled_window_children (void)
+{
+ GtkWidget *sw;
+ AtkObject *accessible;
+
+ sw = gtk_scrolled_window_new (NULL, NULL);
+ g_object_ref_sink (sw);
+ gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
+ GTK_POLICY_ALWAYS, GTK_POLICY_ALWAYS);
+ gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (sw), gtk_label_new ("Bla"));
+
+ accessible = gtk_widget_get_accessible (sw);
+ g_assert_cmpint (atk_object_get_n_accessible_children (accessible), ==, 3);
+
+ g_object_unref (sw);
+}
+
+int
+main (int argc, char *argv[])
+{
+ gtk_test_init (&argc, &argv, NULL);
+
+ g_test_add_func ("/scrolledwindow/children", test_scrolled_window_children);
+ return g_test_run ();
+}
+
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]