mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-25 13:11:13 +00:00
d2c5e3f2b3
Tests the fix in the previous commit.
39 lines
797 B
C
39 lines
797 B
C
#include <gtk/gtk.h>
|
|
|
|
static void
|
|
switch_role (void)
|
|
{
|
|
GtkWidget *widget = gtk_switch_new ();
|
|
g_object_ref_sink (widget);
|
|
|
|
gtk_test_accessible_assert_role (widget, GTK_ACCESSIBLE_ROLE_SWITCH);
|
|
|
|
g_object_unref (widget);
|
|
}
|
|
|
|
static void
|
|
switch_state (void)
|
|
{
|
|
GtkWidget *widget = gtk_switch_new ();
|
|
g_object_ref_sink (widget);
|
|
|
|
gtk_test_accessible_assert_state (widget, GTK_ACCESSIBLE_STATE_CHECKED, FALSE);
|
|
|
|
gtk_switch_set_active (GTK_SWITCH (widget), TRUE);
|
|
|
|
gtk_test_accessible_assert_state (widget, GTK_ACCESSIBLE_STATE_CHECKED, TRUE);
|
|
|
|
g_object_unref (widget);
|
|
}
|
|
|
|
int
|
|
main (int argc, char *argv[])
|
|
{
|
|
gtk_test_init (&argc, &argv, NULL);
|
|
|
|
g_test_add_func ("/a11y/switch/role", switch_role);
|
|
g_test_add_func ("/a11y/switch/state", switch_state);
|
|
|
|
return g_test_run ();
|
|
}
|