1 | #include <gtk/gtk.h> |
2 | |
3 | static void |
4 | entry_role (void) |
5 | { |
6 | GtkWidget *widget = gtk_entry_new (); |
7 | g_object_ref_sink (widget); |
8 | |
9 | gtk_test_accessible_assert_role (widget, GTK_ACCESSIBLE_ROLE_TEXT_BOX); |
10 | |
11 | g_object_unref (object: widget); |
12 | } |
13 | |
14 | static void |
15 | entry_properties (void) |
16 | { |
17 | GtkWidget *widget = gtk_entry_new (); |
18 | g_object_ref_sink (widget); |
19 | |
20 | gtk_test_accessible_assert_property (widget, GTK_ACCESSIBLE_PROPERTY_PLACEHOLDER, NULL); |
21 | gtk_test_accessible_assert_property (widget, GTK_ACCESSIBLE_PROPERTY_READ_ONLY, FALSE); |
22 | |
23 | gtk_entry_set_placeholder_text (GTK_ENTRY (widget), text: "Hello" ); |
24 | gtk_editable_set_editable (GTK_EDITABLE (widget), FALSE); |
25 | |
26 | gtk_test_accessible_assert_property (widget, GTK_ACCESSIBLE_PROPERTY_PLACEHOLDER, "Hello" ); |
27 | gtk_test_accessible_assert_property (widget, GTK_ACCESSIBLE_PROPERTY_READ_ONLY, TRUE); |
28 | |
29 | g_object_unref (object: widget); |
30 | } |
31 | |
32 | int |
33 | main (int argc, char *argv[]) |
34 | { |
35 | gtk_test_init (argcp: &argc, argvp: &argv, NULL); |
36 | |
37 | g_test_add_func (testpath: "/a11y/entry/role" , test_func: entry_role); |
38 | g_test_add_func (testpath: "/a11y/entry/properties" , test_func: entry_properties); |
39 | |
40 | return g_test_run (); |
41 | } |
42 | |