summaryrefslogtreecommitdiff
path: root/tests/at-spi2-atk/atk_test_selection.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/at-spi2-atk/atk_test_selection.c')
-rw-r--r--tests/at-spi2-atk/atk_test_selection.c78
1 files changed, 36 insertions, 42 deletions
diff --git a/tests/at-spi2-atk/atk_test_selection.c b/tests/at-spi2-atk/atk_test_selection.c
index 3c2b2b3e..e9e4f16d 100644
--- a/tests/at-spi2-atk/atk_test_selection.c
+++ b/tests/at-spi2-atk/atk_test_selection.c
@@ -26,15 +26,9 @@
#define DATA_FILE TESTS_DATA_DIR "/test-selection.xml"
static void
-teardown_selection_test (gpointer fixture, gconstpointer user_data)
+atk_test_selection_sample_get_interface (TestAppFixture *fixture, gconstpointer user_data)
{
- terminate_app ();
-}
-
-static void
-atk_test_selection_sample_get_interface (gpointer fixture, gconstpointer user_data)
-{
- AtspiAccessible *obj = get_root_obj (DATA_FILE);
+ AtspiAccessible *obj = fixture->root_obj;
g_assert_cmpstr (atspi_accessible_get_name (obj, NULL), ==, "root_object");
AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 0, NULL);
AtspiSelection *iface = atspi_accessible_get_selection_iface (child);
@@ -42,9 +36,9 @@ atk_test_selection_sample_get_interface (gpointer fixture, gconstpointer user_da
}
static void
-atk_test_selection_get_n_selected_children (gpointer fixture, gconstpointer user_data)
+atk_test_selection_get_n_selected_children (TestAppFixture *fixture, gconstpointer user_data)
{
- AtspiAccessible *obj = get_root_obj (DATA_FILE);
+ AtspiAccessible *obj = fixture->root_obj;
g_assert_cmpstr (atspi_accessible_get_name (obj, NULL), ==, "root_object");
AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 0, NULL);
AtspiSelection *iface = atspi_accessible_get_selection_iface (child);
@@ -54,9 +48,9 @@ atk_test_selection_get_n_selected_children (gpointer fixture, gconstpointer user
}
static void
-atk_test_selection_get_selected_child (gpointer fixture, gconstpointer user_data)
+atk_test_selection_get_selected_child (TestAppFixture *fixture, gconstpointer user_data)
{
- AtspiAccessible *obj = get_root_obj (DATA_FILE);
+ AtspiAccessible *obj = fixture->root_obj;
g_assert_cmpstr (atspi_accessible_get_name (obj, NULL), ==, "root_object");
AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 0, NULL);
AtspiSelection *iface = atspi_accessible_get_selection_iface (child);
@@ -75,9 +69,9 @@ atk_test_selection_get_selected_child (gpointer fixture, gconstpointer user_data
}
static void
-atk_test_selection_select_child (gpointer fixture, gconstpointer user_data)
+atk_test_selection_select_child (TestAppFixture *fixture, gconstpointer user_data)
{
- AtspiAccessible *obj = get_root_obj (DATA_FILE);
+ AtspiAccessible *obj = fixture->root_obj;
g_assert_cmpstr (atspi_accessible_get_name (obj, NULL), ==, "root_object");
AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 0, NULL);
AtspiSelection *iface = atspi_accessible_get_selection_iface (child);
@@ -91,9 +85,9 @@ atk_test_selection_select_child (gpointer fixture, gconstpointer user_data)
}
static void
-atk_test_selection_deselect_selected (gpointer fixture, gconstpointer user_data)
+atk_test_selection_deselect_selected (TestAppFixture *fixture, gconstpointer user_data)
{
- AtspiAccessible *obj = get_root_obj (DATA_FILE);
+ AtspiAccessible *obj = fixture->root_obj;
g_assert_cmpstr (atspi_accessible_get_name (obj, NULL), ==, "root_object");
AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 0, NULL);
AtspiSelection *iface = atspi_accessible_get_selection_iface (child);
@@ -110,9 +104,9 @@ atk_test_selection_deselect_selected (gpointer fixture, gconstpointer user_data)
}
static void
-atk_test_selection_deselect_child (gpointer fixture, gconstpointer user_data)
+atk_test_selection_deselect_child (TestAppFixture *fixture, gconstpointer user_data)
{
- AtspiAccessible *obj = get_root_obj (DATA_FILE);
+ AtspiAccessible *obj = fixture->root_obj;
g_assert_cmpstr (atspi_accessible_get_name (obj, NULL), ==, "root_object");
AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 0, NULL);
AtspiSelection *iface = atspi_accessible_get_selection_iface (child);
@@ -129,9 +123,9 @@ atk_test_selection_deselect_child (gpointer fixture, gconstpointer user_data)
}
static void
-atk_test_selection_is_child_selected (gpointer fixture, gconstpointer user_data)
+atk_test_selection_is_child_selected (TestAppFixture *fixture, gconstpointer user_data)
{
- AtspiAccessible *obj = get_root_obj (DATA_FILE);
+ AtspiAccessible *obj = fixture->root_obj;
g_assert_cmpstr (atspi_accessible_get_name (obj, NULL), ==, "root_object");
AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 0, NULL);
AtspiSelection *iface = atspi_accessible_get_selection_iface (child);
@@ -145,9 +139,9 @@ atk_test_selection_is_child_selected (gpointer fixture, gconstpointer user_data)
}
static void
-atk_test_selection_select_all (gpointer fixture, gconstpointer user_data)
+atk_test_selection_select_all (TestAppFixture *fixture, gconstpointer user_data)
{
- AtspiAccessible *obj = get_root_obj (DATA_FILE);
+ AtspiAccessible *obj = fixture->root_obj;
g_assert_cmpstr (atspi_accessible_get_name (obj, NULL), ==, "root_object");
AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 0, NULL);
AtspiSelection *iface = atspi_accessible_get_selection_iface (child);
@@ -159,9 +153,9 @@ atk_test_selection_select_all (gpointer fixture, gconstpointer user_data)
}
static void
-atk_test_selection_clear_selection (gpointer fixture, gconstpointer user_data)
+atk_test_selection_clear_selection (TestAppFixture *fixture, gconstpointer user_data)
{
- AtspiAccessible *obj = get_root_obj (DATA_FILE);
+ AtspiAccessible *obj = fixture->root_obj;
g_assert_cmpstr (atspi_accessible_get_name (obj, NULL), ==, "root_object");
AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 0, NULL);
AtspiSelection *iface = atspi_accessible_get_selection_iface (child);
@@ -175,22 +169,22 @@ atk_test_selection_clear_selection (gpointer fixture, gconstpointer user_data)
void
atk_test_selection (void)
{
- g_test_add_vtable (ATK_TEST_PATH_SELECTION "/atk_test_selection_sample_get_interface",
- 0, NULL, NULL, atk_test_selection_sample_get_interface, teardown_selection_test);
- g_test_add_vtable (ATK_TEST_PATH_SELECTION "/atk_test_selection_get_n_selected_children",
- 0, NULL, NULL, atk_test_selection_get_n_selected_children, teardown_selection_test);
- g_test_add_vtable (ATK_TEST_PATH_SELECTION "/atk_test_selection_get_selected_child",
- 0, NULL, NULL, atk_test_selection_get_selected_child, teardown_selection_test);
- g_test_add_vtable (ATK_TEST_PATH_SELECTION "/atk_test_selection_select_child",
- 0, NULL, NULL, atk_test_selection_select_child, teardown_selection_test);
- g_test_add_vtable (ATK_TEST_PATH_SELECTION "/atk_test_selection_deselect_selected",
- 0, NULL, NULL, atk_test_selection_deselect_selected, teardown_selection_test);
- g_test_add_vtable (ATK_TEST_PATH_SELECTION "/atk_test_selection_deselect_child",
- 0, NULL, NULL, atk_test_selection_deselect_child, teardown_selection_test);
- g_test_add_vtable (ATK_TEST_PATH_SELECTION "/atk_test_selection_is_child_selected",
- 0, NULL, NULL, atk_test_selection_is_child_selected, teardown_selection_test);
- g_test_add_vtable (ATK_TEST_PATH_SELECTION "/atk_test_selection_select_all",
- 0, NULL, NULL, atk_test_selection_select_all, teardown_selection_test);
- g_test_add_vtable (ATK_TEST_PATH_SELECTION "/atk_test_selection_clear_selection",
- 0, NULL, NULL, atk_test_selection_clear_selection, teardown_selection_test);
+ g_test_add ("/selection/atk_test_selection_sample_get_interface",
+ TestAppFixture, DATA_FILE, fixture_setup, atk_test_selection_sample_get_interface, fixture_teardown);
+ g_test_add ("/selection/atk_test_selection_get_n_selected_children",
+ TestAppFixture, DATA_FILE, fixture_setup, atk_test_selection_get_n_selected_children, fixture_teardown);
+ g_test_add ("/selection/atk_test_selection_get_selected_child",
+ TestAppFixture, DATA_FILE, fixture_setup, atk_test_selection_get_selected_child, fixture_teardown);
+ g_test_add ("/selection/atk_test_selection_select_child",
+ TestAppFixture, DATA_FILE, fixture_setup, atk_test_selection_select_child, fixture_teardown);
+ g_test_add ("/selection/atk_test_selection_deselect_selected",
+ TestAppFixture, DATA_FILE, fixture_setup, atk_test_selection_deselect_selected, fixture_teardown);
+ g_test_add ("/selection/atk_test_selection_deselect_child",
+ TestAppFixture, DATA_FILE, fixture_setup, atk_test_selection_deselect_child, fixture_teardown);
+ g_test_add ("/selection/atk_test_selection_is_child_selected",
+ TestAppFixture, DATA_FILE, fixture_setup, atk_test_selection_is_child_selected, fixture_teardown);
+ g_test_add ("/selection/atk_test_selection_select_all",
+ TestAppFixture, DATA_FILE, fixture_setup, atk_test_selection_select_all, fixture_teardown);
+ g_test_add ("/selection/atk_test_selection_clear_selection",
+ TestAppFixture, DATA_FILE, fixture_setup, atk_test_selection_clear_selection, fixture_teardown);
}