1 | #include <gtk/gtk.h> |
2 | |
3 | static void |
4 | search_entry_role (void) |
5 | { |
6 | GtkWidget *widget = gtk_search_entry_new (); |
7 | g_object_ref_sink (widget); |
8 | |
9 | gtk_test_accessible_assert_role (widget, GTK_ACCESSIBLE_ROLE_SEARCH_BOX); |
10 | |
11 | g_object_unref (object: widget); |
12 | } |
13 | |
14 | static void |
15 | search_entry_properties (void) |
16 | { |
17 | GtkWidget *widget = gtk_search_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 | g_object_set (object: widget, first_property_name: "placeholder-text" , "Hello" , NULL); |
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/searchentry/role" , test_func: search_entry_role); |
38 | g_test_add_func (testpath: "/a11y/searchentry/properties" , test_func: search_entry_properties); |
39 | |
40 | return g_test_run (); |
41 | } |
42 | |