1 | #include <gtk/gtk.h> |
2 | |
3 | static void |
4 | window_role (void) |
5 | { |
6 | GtkWidget *window = gtk_window_new (); |
7 | |
8 | gtk_test_accessible_assert_role (window, GTK_ACCESSIBLE_ROLE_WINDOW); |
9 | |
10 | gtk_window_destroy (GTK_WINDOW (window)); |
11 | } |
12 | |
13 | static void |
14 | window_state (void) |
15 | { |
16 | GtkWidget *window = gtk_window_new (); |
17 | |
18 | gtk_window_present (GTK_WINDOW (window)); |
19 | |
20 | gtk_test_accessible_assert_state (window, GTK_ACCESSIBLE_STATE_HIDDEN, FALSE); |
21 | |
22 | gtk_widget_hide (widget: window); |
23 | |
24 | gtk_test_accessible_assert_state (window, GTK_ACCESSIBLE_STATE_HIDDEN, TRUE); |
25 | |
26 | gtk_window_destroy (GTK_WINDOW (window)); |
27 | } |
28 | |
29 | static void |
30 | window_properties (void) |
31 | { |
32 | GtkWidget *window = gtk_window_new (); |
33 | |
34 | gtk_window_set_modal (GTK_WINDOW (window), TRUE); |
35 | |
36 | gtk_test_accessible_assert_property (window, GTK_ACCESSIBLE_PROPERTY_MODAL, TRUE); |
37 | gtk_window_set_modal (GTK_WINDOW (window), FALSE); |
38 | |
39 | gtk_test_accessible_assert_property (window, GTK_ACCESSIBLE_PROPERTY_MODAL, FALSE); |
40 | |
41 | gtk_window_destroy (GTK_WINDOW (window)); |
42 | } |
43 | |
44 | int |
45 | main (int argc, char *argv[]) |
46 | { |
47 | gtk_test_init (argcp: &argc, argvp: &argv, NULL); |
48 | |
49 | g_test_add_func (testpath: "/a11y/window/role" , test_func: window_role); |
50 | g_test_add_func (testpath: "/a11y/window/state" , test_func: window_state); |
51 | g_test_add_func (testpath: "/a11y/window/properties" , test_func: window_properties); |
52 | |
53 | return g_test_run (); |
54 | } |
55 | |