diff options
Diffstat (limited to 'WebKit/gtk/tests/testatk.c')
-rw-r--r-- | WebKit/gtk/tests/testatk.c | 1002 |
1 files changed, 497 insertions, 505 deletions
diff --git a/WebKit/gtk/tests/testatk.c b/WebKit/gtk/tests/testatk.c index bd6473a..509cb86 100644 --- a/WebKit/gtk/tests/testatk.c +++ b/WebKit/gtk/tests/testatk.c @@ -18,10 +18,10 @@ */ #include <errno.h> -#include <unistd.h> #include <glib.h> #include <glib/gstdio.h> #include <gtk/gtk.h> +#include <unistd.h> #include <webkit/webkit.h> #if GLIB_CHECK_VERSION(2, 16, 0) && GTK_CHECK_VERSION(2, 14, 0) @@ -46,6 +46,8 @@ static const char* contentsInTableWithHeaders = "<html><body><table><tr><th>foo< static const char* formWithTextInputs = "<html><body><form><input type='text' name='entry' /></form></body></html>"; +static const char* hypertextAndHyperlinks = "<html><body><p>A paragraph with no links at all</p><p><a href='http://foo.bar.baz/'>A line</a> with <a href='http://bar.baz.foo/'>a link in the middle</a> as well as at the beginning and <a href='http://baz.foo.bar/'>at the end</a></p></body></html>"; + static const char* layoutAndDataTables = "<html><body><table><tr><th>Odd</th><th>Even</th></tr><tr><td>1</td><td>2</td></tr></table><table><tr><td>foo</td><td>bar</td></tr></table></body></html>"; static const char* linksWithInlineImages = "<html><head><style>a.http:before {content: url(no-image.png);}</style><body><p><a class='http' href='foo'>foo</a> bar baz</p><p>foo <a class='http' href='bar'>bar</a> baz</p><p>foo bar <a class='http' href='baz'>baz</a></p></body></html>"; @@ -56,474 +58,411 @@ static const char* textForSelections = "<html><body><p>A paragraph with plain te static const char* textWithAttributes = "<html><head><style>.st1 {font-family: monospace; color:rgb(120,121,122);} .st2 {text-decoration:underline; background-color:rgb(80,81,82);}</style></head><body><p style=\"font-size:14; text-align:right;\">This is the <i>first</i><b> sentence of this text.</b></p><p class=\"st1\">This sentence should have an style applied <span class=\"st2\">and this part should have another one</span>.</p><p>x<sub>1</sub><sup>2</sup>=x<sub>2</sub><sup>3</sup></p><p style=\"text-align:center;\">This sentence is the <strike>last</strike> one.</p></body></html>"; -static gboolean bail_out(GMainLoop* loop) +static void waitForAccessibleObjects() { - if (g_main_loop_is_running(loop)) - g_main_loop_quit(loop); - - return FALSE; + /* Manually spin the main context to make sure the accessible + objects are properly created before continuing. */ + while (g_main_context_pending(0)) + g_main_context_iteration(0, TRUE); } typedef gchar* (*AtkGetTextFunction) (AtkText*, gint, AtkTextBoundary, gint*, gint*); -static void test_get_text_function(AtkText* text_obj, AtkGetTextFunction fn, AtkTextBoundary boundary, gint offset, const char* text_result, gint start_offset_result, gint end_offset_result) +static void testGetTextFunction(AtkText* textObject, AtkGetTextFunction fn, AtkTextBoundary boundary, gint offset, const char* textResult, gint startOffsetResult, gint endOffsetResult) { - gint start_offset, end_offset; - char* text; - - text = fn(text_obj, offset, boundary, &start_offset, &end_offset); - g_assert_cmpstr(text, ==, text_result); - g_assert_cmpint(start_offset, ==, start_offset_result); - g_assert_cmpint(end_offset, ==, end_offset_result); + gint startOffset; + gint endOffset; + char* text = fn(textObject, offset, boundary, &startOffset, &endOffset); + g_assert_cmpstr(text, ==, textResult); + g_assert_cmpint(startOffset, ==, startOffsetResult); + g_assert_cmpint(endOffset, ==, endOffsetResult); g_free(text); } -static void run_get_text_tests(AtkText* text_obj) +static void runGetTextTests(AtkText* textObject) { - char* text = atk_text_get_text(text_obj, 0, -1); + char* text = atk_text_get_text(textObject, 0, -1); g_assert_cmpstr(text, ==, "This is a test. This is the second sentence. And this the third."); g_free(text); /* ATK_TEXT_BOUNDARY_CHAR */ - test_get_text_function(text_obj, atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_CHAR, - 0, "T", 0, 1); + testGetTextFunction(textObject, atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_CHAR, + 0, "T", 0, 1); - test_get_text_function(text_obj, atk_text_get_text_after_offset, ATK_TEXT_BOUNDARY_CHAR, - 0, "h", 1, 2); + testGetTextFunction(textObject, atk_text_get_text_after_offset, ATK_TEXT_BOUNDARY_CHAR, + 0, "h", 1, 2); - test_get_text_function(text_obj, atk_text_get_text_before_offset, ATK_TEXT_BOUNDARY_CHAR, - 0, "", 0, 0); + testGetTextFunction(textObject, atk_text_get_text_before_offset, ATK_TEXT_BOUNDARY_CHAR, + 0, "", 0, 0); + + testGetTextFunction(textObject, atk_text_get_text_before_offset, ATK_TEXT_BOUNDARY_CHAR, + 1, "T", 0, 1); - test_get_text_function(text_obj, atk_text_get_text_before_offset, ATK_TEXT_BOUNDARY_CHAR, - 1, "T", 0, 1); - /* ATK_TEXT_BOUNDARY_WORD_START */ - test_get_text_function(text_obj, atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_WORD_START, - 0, "This ", 0, 5); + testGetTextFunction(textObject, atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_WORD_START, + 0, "This ", 0, 5); - test_get_text_function(text_obj, atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_WORD_START, - 4, "This ", 0, 5); + testGetTextFunction(textObject, atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_WORD_START, + 4, "This ", 0, 5); - test_get_text_function(text_obj, atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_WORD_START, - 10, "test. ", 10, 16); + testGetTextFunction(textObject, atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_WORD_START, + 10, "test. ", 10, 16); - test_get_text_function(text_obj, atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_WORD_START, - 58, "third.", 58, 64); + testGetTextFunction(textObject, atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_WORD_START, + 58, "third.", 58, 64); - test_get_text_function(text_obj, atk_text_get_text_before_offset, ATK_TEXT_BOUNDARY_WORD_START, - 5, "This ", 0, 5); + testGetTextFunction(textObject, atk_text_get_text_before_offset, ATK_TEXT_BOUNDARY_WORD_START, + 5, "This ", 0, 5); - test_get_text_function(text_obj, atk_text_get_text_before_offset, ATK_TEXT_BOUNDARY_WORD_START, - 7, "This ", 0, 5); + testGetTextFunction(textObject, atk_text_get_text_before_offset, ATK_TEXT_BOUNDARY_WORD_START, + 7, "This ", 0, 5); - test_get_text_function(text_obj, atk_text_get_text_after_offset, ATK_TEXT_BOUNDARY_WORD_START, - 0, "is ", 5, 8); + testGetTextFunction(textObject, atk_text_get_text_after_offset, ATK_TEXT_BOUNDARY_WORD_START, + 0, "is ", 5, 8); - test_get_text_function(text_obj, atk_text_get_text_after_offset, ATK_TEXT_BOUNDARY_WORD_START, - 4, "is ", 5, 8); + testGetTextFunction(textObject, atk_text_get_text_after_offset, ATK_TEXT_BOUNDARY_WORD_START, + 4, "is ", 5, 8); - test_get_text_function(text_obj, atk_text_get_text_after_offset, ATK_TEXT_BOUNDARY_WORD_START, - 3, "is ", 5, 8); + testGetTextFunction(textObject, atk_text_get_text_after_offset, ATK_TEXT_BOUNDARY_WORD_START, + 3, "is ", 5, 8); /* ATK_TEXT_BOUNDARY_WORD_END */ - test_get_text_function(text_obj, atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_WORD_END, - 0, "This", 0, 4); + testGetTextFunction(textObject, atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_WORD_END, + 0, "This", 0, 4); - test_get_text_function(text_obj, atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_WORD_END, - 4, " is", 4, 7); + testGetTextFunction(textObject, atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_WORD_END, + 4, " is", 4, 7); - test_get_text_function(text_obj, atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_WORD_END, - 5, " is", 4, 7); + testGetTextFunction(textObject, atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_WORD_END, + 5, " is", 4, 7); - test_get_text_function(text_obj, atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_WORD_END, - 9, " test", 9, 14); + testGetTextFunction(textObject, atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_WORD_END, + 9, " test", 9, 14); - test_get_text_function(text_obj, atk_text_get_text_before_offset, ATK_TEXT_BOUNDARY_WORD_END, - 5, "This", 0, 4); + testGetTextFunction(textObject, atk_text_get_text_before_offset, ATK_TEXT_BOUNDARY_WORD_END, + 5, "This", 0, 4); - test_get_text_function(text_obj, atk_text_get_text_before_offset, ATK_TEXT_BOUNDARY_WORD_END, - 4, "This", 0, 4); + testGetTextFunction(textObject, atk_text_get_text_before_offset, ATK_TEXT_BOUNDARY_WORD_END, + 4, "This", 0, 4); - test_get_text_function(text_obj, atk_text_get_text_before_offset, ATK_TEXT_BOUNDARY_WORD_END, - 7, " is", 4, 7); + testGetTextFunction(textObject, atk_text_get_text_before_offset, ATK_TEXT_BOUNDARY_WORD_END, + 7, " is", 4, 7); - test_get_text_function(text_obj, atk_text_get_text_after_offset, ATK_TEXT_BOUNDARY_WORD_END, - 5, " a", 7, 9); + testGetTextFunction(textObject, atk_text_get_text_after_offset, ATK_TEXT_BOUNDARY_WORD_END, + 5, " a", 7, 9); - test_get_text_function(text_obj, atk_text_get_text_after_offset, ATK_TEXT_BOUNDARY_WORD_END, - 4, " a", 7, 9); + testGetTextFunction(textObject, atk_text_get_text_after_offset, ATK_TEXT_BOUNDARY_WORD_END, + 4, " a", 7, 9); - test_get_text_function(text_obj, atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_WORD_END, - 58, " third", 57, 63); + testGetTextFunction(textObject, atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_WORD_END, + 58, " third", 57, 63); /* ATK_TEXT_BOUNDARY_SENTENCE_START */ - test_get_text_function(text_obj, atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_SENTENCE_START, - 0, "This is a test. ", 0, 16); + testGetTextFunction(textObject, atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_SENTENCE_START, + 0, "This is a test. ", 0, 16); - test_get_text_function(text_obj, atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_SENTENCE_START, - 15, "This is a test. ", 0, 16); + testGetTextFunction(textObject, atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_SENTENCE_START, + 15, "This is a test. ", 0, 16); - test_get_text_function(text_obj, atk_text_get_text_after_offset, ATK_TEXT_BOUNDARY_SENTENCE_START, - 0, "This is the second sentence. ", 16, 45); + testGetTextFunction(textObject, atk_text_get_text_after_offset, ATK_TEXT_BOUNDARY_SENTENCE_START, + 0, "This is the second sentence. ", 16, 45); - test_get_text_function(text_obj, atk_text_get_text_after_offset, ATK_TEXT_BOUNDARY_SENTENCE_START, - 15, "This is the second sentence. ", 16, 45); + testGetTextFunction(textObject, atk_text_get_text_after_offset, ATK_TEXT_BOUNDARY_SENTENCE_START, + 15, "This is the second sentence. ", 16, 45); - test_get_text_function(text_obj, atk_text_get_text_before_offset, ATK_TEXT_BOUNDARY_SENTENCE_START, - 16, "This is a test. ", 0, 16); + testGetTextFunction(textObject, atk_text_get_text_before_offset, ATK_TEXT_BOUNDARY_SENTENCE_START, + 16, "This is a test. ", 0, 16); - test_get_text_function(text_obj, atk_text_get_text_before_offset, ATK_TEXT_BOUNDARY_SENTENCE_START, - 44, "This is a test. ", 0, 16); + testGetTextFunction(textObject, atk_text_get_text_before_offset, ATK_TEXT_BOUNDARY_SENTENCE_START, + 44, "This is a test. ", 0, 16); - test_get_text_function(text_obj, atk_text_get_text_before_offset, ATK_TEXT_BOUNDARY_SENTENCE_START, - 15, "", 0, 0); + testGetTextFunction(textObject, atk_text_get_text_before_offset, ATK_TEXT_BOUNDARY_SENTENCE_START, + 15, "", 0, 0); /* ATK_TEXT_BOUNDARY_SENTENCE_END */ - test_get_text_function(text_obj, atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_SENTENCE_END, - 0, "This is a test.", 0, 15); + testGetTextFunction(textObject, atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_SENTENCE_END, + 0, "This is a test.", 0, 15); - test_get_text_function(text_obj, atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_SENTENCE_END, - 15, " This is the second sentence.", 15, 44); + testGetTextFunction(textObject, atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_SENTENCE_END, + 15, " This is the second sentence.", 15, 44); - test_get_text_function(text_obj, atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_SENTENCE_END, - 16, " This is the second sentence.", 15, 44); + testGetTextFunction(textObject, atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_SENTENCE_END, + 16, " This is the second sentence.", 15, 44); - test_get_text_function(text_obj, atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_SENTENCE_END, - 17, " This is the second sentence.", 15, 44); + testGetTextFunction(textObject, atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_SENTENCE_END, + 17, " This is the second sentence.", 15, 44); - test_get_text_function(text_obj, atk_text_get_text_after_offset, ATK_TEXT_BOUNDARY_SENTENCE_END, - 0, " This is the second sentence.", 15, 44); + testGetTextFunction(textObject, atk_text_get_text_after_offset, ATK_TEXT_BOUNDARY_SENTENCE_END, + 0, " This is the second sentence.", 15, 44); - test_get_text_function(text_obj, atk_text_get_text_after_offset, ATK_TEXT_BOUNDARY_SENTENCE_END, - 15, " And this the third.", 44, 64); + testGetTextFunction(textObject, atk_text_get_text_after_offset, ATK_TEXT_BOUNDARY_SENTENCE_END, + 15, " And this the third.", 44, 64); - test_get_text_function(text_obj, atk_text_get_text_before_offset, ATK_TEXT_BOUNDARY_SENTENCE_END, - 16, "This is a test.", 0, 15); + testGetTextFunction(textObject, atk_text_get_text_before_offset, ATK_TEXT_BOUNDARY_SENTENCE_END, + 16, "This is a test.", 0, 15); - test_get_text_function(text_obj, atk_text_get_text_before_offset, ATK_TEXT_BOUNDARY_SENTENCE_END, - 15, "This is a test.", 0, 15); + testGetTextFunction(textObject, atk_text_get_text_before_offset, ATK_TEXT_BOUNDARY_SENTENCE_END, + 15, "This is a test.", 0, 15); - test_get_text_function(text_obj, atk_text_get_text_before_offset, ATK_TEXT_BOUNDARY_SENTENCE_END, - 14, "", 0, 0); + testGetTextFunction(textObject, atk_text_get_text_before_offset, ATK_TEXT_BOUNDARY_SENTENCE_END, + 14, "", 0, 0); - test_get_text_function(text_obj, atk_text_get_text_before_offset, ATK_TEXT_BOUNDARY_SENTENCE_END, - 44, " This is the second sentence.", 15, 44); + testGetTextFunction(textObject, atk_text_get_text_before_offset, ATK_TEXT_BOUNDARY_SENTENCE_END, + 44, " This is the second sentence.", 15, 44); /* It's trick to test these properly right now, since our a11y - implementation splits different lines in different a11y - items */ + implementation splits different lines in different a11y items. */ /* ATK_TEXT_BOUNDARY_LINE_START */ - test_get_text_function(text_obj, atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_LINE_START, - 0, "This is a test. This is the second sentence. And this the third.", 0, 64); + testGetTextFunction(textObject, atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_LINE_START, + 0, "This is a test. This is the second sentence. And this the third.", 0, 64); /* ATK_TEXT_BOUNDARY_LINE_END */ - test_get_text_function(text_obj, atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_LINE_END, - 0, "This is a test. This is the second sentence. And this the third.", 0, 64); + testGetTextFunction(textObject, atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_LINE_END, + 0, "This is a test. This is the second sentence. And this the third.", 0, 64); } -static void test_webkit_atk_get_text_at_offset_forms(void) +static void testWebkitAtkGetTextAtOffsetForms() { - WebKitWebView* webView; - AtkObject* obj; - GMainLoop* loop; - AtkText* text_obj; - - webView = WEBKIT_WEB_VIEW(webkit_web_view_new()); + WebKitWebView* webView = WEBKIT_WEB_VIEW(webkit_web_view_new()); g_object_ref_sink(webView); - GtkAllocation alloc = { 0, 0, 800, 600 }; - gtk_widget_size_allocate(GTK_WIDGET(webView), &alloc); - webkit_web_view_load_string(webView, contents, NULL, NULL, NULL); - loop = g_main_loop_new(NULL, TRUE); + GtkAllocation allocation = { 0, 0, 800, 600 }; + gtk_widget_size_allocate(GTK_WIDGET(webView), &allocation); + webkit_web_view_load_string(webView, contents, 0, 0, 0); - g_idle_add((GSourceFunc)bail_out, loop); - g_main_loop_run(loop); + /* Wait for the accessible objects to be created. */ + waitForAccessibleObjects(); - /* Get to the inner AtkText object */ - obj = gtk_widget_get_accessible(GTK_WIDGET(webView)); - g_assert(obj); - obj = atk_object_ref_accessible_child(obj, 0); - g_assert(obj); + /* Get to the inner AtkText object. */ + AtkObject* object = gtk_widget_get_accessible(GTK_WIDGET(webView)); + g_assert(object); + object = atk_object_ref_accessible_child(object, 0); + g_assert(object); - text_obj = ATK_TEXT(obj); - g_assert(ATK_IS_TEXT(text_obj)); + AtkText* textObject = ATK_TEXT(object); + g_assert(ATK_IS_TEXT(textObject)); - run_get_text_tests(text_obj); + runGetTextTests(textObject); g_object_unref(webView); } -static void test_webkit_atk_get_text_at_offset(void) +static void testWebkitAtkGetTextAtOffset() { - WebKitWebView* webView; - AtkObject* obj; - GMainLoop* loop; - AtkText* text_obj; - - webView = WEBKIT_WEB_VIEW(webkit_web_view_new()); + WebKitWebView* webView = WEBKIT_WEB_VIEW(webkit_web_view_new()); g_object_ref_sink(webView); - GtkAllocation alloc = { 0, 0, 800, 600 }; - gtk_widget_size_allocate(GTK_WIDGET(webView), &alloc); - webkit_web_view_load_string(webView, contents, NULL, NULL, NULL); - loop = g_main_loop_new(NULL, TRUE); + GtkAllocation allocation = { 0, 0, 800, 600 }; + gtk_widget_size_allocate(GTK_WIDGET(webView), &allocation); + webkit_web_view_load_string(webView, contents, 0, 0, 0); - g_idle_add((GSourceFunc)bail_out, loop); - g_main_loop_run(loop); + /* Wait for the accessible objects to be created. */ + waitForAccessibleObjects(); - /* Get to the inner AtkText object */ - obj = gtk_widget_get_accessible(GTK_WIDGET(webView)); - g_assert(obj); - obj = atk_object_ref_accessible_child(obj, 0); - g_assert(obj); + /* Get to the inner AtkText object. */ + AtkObject* object = gtk_widget_get_accessible(GTK_WIDGET(webView)); + g_assert(object); + object = atk_object_ref_accessible_child(object, 0); + g_assert(object); - text_obj = ATK_TEXT(obj); - g_assert(ATK_IS_TEXT(text_obj)); + AtkText* textObject = ATK_TEXT(object); + g_assert(ATK_IS_TEXT(textObject)); - run_get_text_tests(text_obj); + runGetTextTests(textObject); g_object_unref(webView); } -static void test_webkit_atk_get_text_at_offset_newlines(void) +static void testWebkitAtkGetTextAtOffsetNewlines() { - WebKitWebView* webView; - AtkObject* obj; - GMainLoop* loop; - AtkText* text_obj; - - webView = WEBKIT_WEB_VIEW(webkit_web_view_new()); + WebKitWebView* webView = WEBKIT_WEB_VIEW(webkit_web_view_new()); g_object_ref_sink(webView); - GtkAllocation alloc = { 0, 0, 800, 600 }; - gtk_widget_size_allocate(GTK_WIDGET(webView), &alloc); - webkit_web_view_load_string(webView, contentsWithNewlines, NULL, NULL, NULL); - loop = g_main_loop_new(NULL, TRUE); + GtkAllocation allocation = { 0, 0, 800, 600 }; + gtk_widget_size_allocate(GTK_WIDGET(webView), &allocation); + webkit_web_view_load_string(webView, contentsWithNewlines, 0, 0, 0); - g_idle_add((GSourceFunc)bail_out, loop); - g_main_loop_run(loop); + /* Wait for the accessible objects to be created. */ + waitForAccessibleObjects(); - /* Get to the inner AtkText object */ - obj = gtk_widget_get_accessible(GTK_WIDGET(webView)); - g_assert(obj); - obj = atk_object_ref_accessible_child(obj, 0); - g_assert(obj); + /* Get to the inner AtkText object. */ + AtkObject* object = gtk_widget_get_accessible(GTK_WIDGET(webView)); + g_assert(object); + object = atk_object_ref_accessible_child(object, 0); + g_assert(object); - text_obj = ATK_TEXT(obj); - g_assert(ATK_IS_TEXT(text_obj)); + AtkText* textObject = ATK_TEXT(object); + g_assert(ATK_IS_TEXT(textObject)); - run_get_text_tests(text_obj); + runGetTextTests(textObject); g_object_unref(webView); } -static void test_webkit_atk_get_text_at_offset_textarea(void) +static void testWebkitAtkGetTextAtOffsetTextarea() { - WebKitWebView* webView; - AtkObject* obj; - GMainLoop* loop; - AtkText* text_obj; - - webView = WEBKIT_WEB_VIEW(webkit_web_view_new()); + WebKitWebView* webView = WEBKIT_WEB_VIEW(webkit_web_view_new()); g_object_ref_sink(webView); - GtkAllocation alloc = { 0, 0, 800, 600 }; - gtk_widget_size_allocate(GTK_WIDGET(webView), &alloc); - webkit_web_view_load_string(webView, contentsInTextarea, NULL, NULL, NULL); - loop = g_main_loop_new(NULL, TRUE); + GtkAllocation allocation = { 0, 0, 800, 600 }; + gtk_widget_size_allocate(GTK_WIDGET(webView), &allocation); + webkit_web_view_load_string(webView, contentsInTextarea, 0, 0, 0); - g_idle_add((GSourceFunc)bail_out, loop); - g_main_loop_run(loop); + /* Wait for the accessible objects to be created. */ + waitForAccessibleObjects(); - /* Get to the inner AtkText object */ - obj = gtk_widget_get_accessible(GTK_WIDGET(webView)); - g_assert(obj); - obj = atk_object_ref_accessible_child(obj, 0); - g_assert(obj); - obj = atk_object_ref_accessible_child(obj, 0); - g_assert(obj); + /* Get to the inner AtkText object. */ + AtkObject* object = gtk_widget_get_accessible(GTK_WIDGET(webView)); + g_assert(object); + object = atk_object_ref_accessible_child(object, 0); + g_assert(object); + object = atk_object_ref_accessible_child(object, 0); + g_assert(object); - text_obj = ATK_TEXT(obj); - g_assert(ATK_IS_TEXT(text_obj)); + AtkText* textObject = ATK_TEXT(object); + g_assert(ATK_IS_TEXT(textObject)); - run_get_text_tests(text_obj); + runGetTextTests(textObject); g_object_unref(webView); } -static void test_webkit_atk_get_text_at_offset_text_input(void) +static void testWebkitAtkGetTextAtOffsetTextInput() { - WebKitWebView* webView; - AtkObject* obj; - GMainLoop* loop; - AtkText* text_obj; - - webView = WEBKIT_WEB_VIEW(webkit_web_view_new()); + WebKitWebView* webView = WEBKIT_WEB_VIEW(webkit_web_view_new()); g_object_ref_sink(webView); - GtkAllocation alloc = { 0, 0, 800, 600 }; - gtk_widget_size_allocate(GTK_WIDGET(webView), &alloc); - webkit_web_view_load_string(webView, contentsInTextInput, NULL, NULL, NULL); - loop = g_main_loop_new(NULL, TRUE); + GtkAllocation allocation = { 0, 0, 800, 600 }; + gtk_widget_size_allocate(GTK_WIDGET(webView), &allocation); + webkit_web_view_load_string(webView, contentsInTextInput, 0, 0, 0); - g_idle_add((GSourceFunc)bail_out, loop); - g_main_loop_run(loop); + /* Wait for the accessible objects to be created. */ + waitForAccessibleObjects(); - /* Get to the inner AtkText object */ - obj = gtk_widget_get_accessible(GTK_WIDGET(webView)); - g_assert(obj); - obj = atk_object_ref_accessible_child(obj, 0); - g_assert(obj); - obj = atk_object_ref_accessible_child(obj, 0); - g_assert(obj); + /* Get to the inner AtkText object. */ + AtkObject* object = gtk_widget_get_accessible(GTK_WIDGET(webView)); + g_assert(object); + object = atk_object_ref_accessible_child(object, 0); + g_assert(object); + object = atk_object_ref_accessible_child(object, 0); + g_assert(object); - text_obj = ATK_TEXT(obj); - g_assert(ATK_IS_TEXT(text_obj)); + AtkText* textObject = ATK_TEXT(object); + g_assert(ATK_IS_TEXT(textObject)); - run_get_text_tests(text_obj); + runGetTextTests(textObject); g_object_unref(webView); } -static void testWebkitAtkGetTextInParagraphAndBodySimple(void) +static void testWebkitAtkGetTextInParagraphAndBodySimple() { - WebKitWebView* webView; - AtkObject* obj; - AtkObject* obj1; - AtkObject* obj2; - GMainLoop* loop; - AtkText* textObj1; - AtkText* textObj2; - - webView = WEBKIT_WEB_VIEW(webkit_web_view_new()); + WebKitWebView* webView = WEBKIT_WEB_VIEW(webkit_web_view_new()); g_object_ref_sink(webView); - GtkAllocation alloc = { 0, 0, 800, 600 }; - gtk_widget_size_allocate(GTK_WIDGET(webView), &alloc); - webkit_web_view_load_string(webView, contentsInParagraphAndBodySimple, NULL, NULL, NULL); - loop = g_main_loop_new(NULL, TRUE); - - g_idle_add((GSourceFunc)bail_out, loop); - g_main_loop_run(loop); - - /* Get to the inner AtkText object */ - obj = gtk_widget_get_accessible(GTK_WIDGET(webView)); - g_assert(obj); - obj1 = atk_object_ref_accessible_child(obj, 0); - g_assert(obj1); - obj2 = atk_object_ref_accessible_child(obj, 1); - g_assert(obj2); - - textObj1 = ATK_TEXT(obj1); - g_assert(ATK_IS_TEXT(textObj1)); - textObj2 = ATK_TEXT(obj2); - g_assert(ATK_IS_TEXT(textObj2)); - - char *text = atk_text_get_text(textObj1, 0, -1); + GtkAllocation allocation = { 0, 0, 800, 600 }; + gtk_widget_size_allocate(GTK_WIDGET(webView), &allocation); + webkit_web_view_load_string(webView, contentsInParagraphAndBodySimple, 0, 0, 0); + + /* Wait for the accessible objects to be created. */ + waitForAccessibleObjects(); + + /* Get to the inner AtkText object. */ + AtkObject* object = gtk_widget_get_accessible(GTK_WIDGET(webView)); + g_assert(object); + AtkObject* object1 = atk_object_ref_accessible_child(object, 0); + g_assert(object1); + AtkObject* object2 = atk_object_ref_accessible_child(object, 1); + g_assert(object2); + + AtkText* textObject1 = ATK_TEXT(object1); + g_assert(ATK_IS_TEXT(textObject1)); + AtkText* textObject2 = ATK_TEXT(object2); + g_assert(ATK_IS_TEXT(textObject2)); + + char *text = atk_text_get_text(textObject1, 0, -1); g_assert_cmpstr(text, ==, "This is a test."); - text = atk_text_get_text(textObj2, 0, 12); + text = atk_text_get_text(textObject2, 0, 12); g_assert_cmpstr(text, ==, "Hello world."); - g_object_unref(obj1); - g_object_unref(obj2); + g_object_unref(object1); + g_object_unref(object2); g_object_unref(webView); } -static void testWebkitAtkGetTextInParagraphAndBodyModerate(void) +static void testWebkitAtkGetTextInParagraphAndBodyModerate() { - WebKitWebView* webView; - AtkObject* obj; - AtkObject* obj1; - AtkObject* obj2; - GMainLoop* loop; - AtkText* textObj1; - AtkText* textObj2; - - webView = WEBKIT_WEB_VIEW(webkit_web_view_new()); + WebKitWebView* webView = WEBKIT_WEB_VIEW(webkit_web_view_new()); g_object_ref_sink(webView); - GtkAllocation alloc = { 0, 0, 800, 600 }; - gtk_widget_size_allocate(GTK_WIDGET(webView), &alloc); - webkit_web_view_load_string(webView, contentsInParagraphAndBodyModerate, NULL, NULL, NULL); - loop = g_main_loop_new(NULL, TRUE); - - g_idle_add((GSourceFunc)bail_out, loop); - g_main_loop_run(loop); - - /* Get to the inner AtkText object */ - obj = gtk_widget_get_accessible(GTK_WIDGET(webView)); - g_assert(obj); - obj1 = atk_object_ref_accessible_child(obj, 0); - g_assert(obj1); - obj2 = atk_object_ref_accessible_child(obj, 1); - g_assert(obj2); - - textObj1 = ATK_TEXT(obj1); - g_assert(ATK_IS_TEXT(textObj1)); - textObj2 = ATK_TEXT(obj2); - g_assert(ATK_IS_TEXT(textObj2)); - - char *text = atk_text_get_text(textObj1, 0, -1); + GtkAllocation allocation = { 0, 0, 800, 600 }; + gtk_widget_size_allocate(GTK_WIDGET(webView), &allocation); + webkit_web_view_load_string(webView, contentsInParagraphAndBodyModerate, 0, 0, 0); + + /* Wait for the accessible objects to be created. */ + waitForAccessibleObjects(); + + /* Get to the inner AtkText object. */ + AtkObject* object = gtk_widget_get_accessible(GTK_WIDGET(webView)); + g_assert(object); + AtkObject* object1 = atk_object_ref_accessible_child(object, 0); + g_assert(object1); + AtkObject* object2 = atk_object_ref_accessible_child(object, 1); + g_assert(object2); + + AtkText* textObject1 = ATK_TEXT(object1); + g_assert(ATK_IS_TEXT(textObject1)); + AtkText* textObject2 = ATK_TEXT(object2); + g_assert(ATK_IS_TEXT(textObject2)); + + char *text = atk_text_get_text(textObject1, 0, -1); g_assert_cmpstr(text, ==, "This is a test."); - text = atk_text_get_text(textObj2, 0, 53); + text = atk_text_get_text(textObject2, 0, 53); g_assert_cmpstr(text, ==, "Hello world.\nThis sentence is green.\nThis one is not."); - g_object_unref(obj1); - g_object_unref(obj2); + g_object_unref(object1); + g_object_unref(object2); g_object_unref(webView); } -static void testWebkitAtkGetTextInTable(void) +static void testWebkitAtkGetTextInTable() { - WebKitWebView* webView; - AtkObject* obj; - GMainLoop* loop; - - webView = WEBKIT_WEB_VIEW(webkit_web_view_new()); + WebKitWebView* webView = WEBKIT_WEB_VIEW(webkit_web_view_new()); g_object_ref_sink(webView); - GtkAllocation alloc = { 0, 0, 800, 600 }; - gtk_widget_size_allocate(GTK_WIDGET(webView), &alloc); - webkit_web_view_load_string(webView, contentsInTable, NULL, NULL, NULL); - loop = g_main_loop_new(NULL, TRUE); + GtkAllocation allocation = { 0, 0, 800, 600 }; + gtk_widget_size_allocate(GTK_WIDGET(webView), &allocation); + webkit_web_view_load_string(webView, contentsInTable, 0, 0, 0); - g_idle_add((GSourceFunc)bail_out, loop); - g_main_loop_run(loop); + /* Wait for the accessible objects to be created. */ + waitForAccessibleObjects(); - obj = gtk_widget_get_accessible(GTK_WIDGET(webView)); - g_assert(obj); - obj = atk_object_ref_accessible_child(obj, 0); - g_assert(obj); + AtkObject* object = gtk_widget_get_accessible(GTK_WIDGET(webView)); + g_assert(object); + object = atk_object_ref_accessible_child(object, 0); + g_assert(object); - /* Tables should not implement AtkText */ - g_assert(G_TYPE_INSTANCE_GET_INTERFACE(obj, ATK_TYPE_TEXT, AtkTextIface) == NULL); + /* Tables should not implement AtkText. */ + g_assert(!G_TYPE_INSTANCE_GET_INTERFACE(object, ATK_TYPE_TEXT, AtkTextIface)); - g_object_unref(obj); + g_object_unref(object); g_object_unref(webView); } -static void testWebkitAtkGetHeadersInTable(void) +static void testWebkitAtkGetHeadersInTable() { - WebKitWebView* webView; - AtkObject* axWebView; - AtkObject* table; - AtkObject* colHeader; - AtkObject* rowHeader; - GMainLoop* loop; - - webView = WEBKIT_WEB_VIEW(webkit_web_view_new()); + WebKitWebView* webView = WEBKIT_WEB_VIEW(webkit_web_view_new()); g_object_ref_sink(webView); - GtkAllocation alloc = { 0, 0, 800, 600 }; - gtk_widget_size_allocate(GTK_WIDGET(webView), &alloc); - webkit_web_view_load_string(webView, contentsInTableWithHeaders, NULL, NULL, NULL); - loop = g_main_loop_new(NULL, TRUE); + GtkAllocation allocation = { 0, 0, 800, 600 }; + gtk_widget_size_allocate(GTK_WIDGET(webView), &allocation); + webkit_web_view_load_string(webView, contentsInTableWithHeaders, 0, 0, 0); - g_idle_add((GSourceFunc)bail_out, loop); - g_main_loop_run(loop); + /* Wait for the accessible objects to be created. */ + waitForAccessibleObjects(); - axWebView = gtk_widget_get_accessible(GTK_WIDGET(webView)); + AtkObject* axWebView = gtk_widget_get_accessible(GTK_WIDGET(webView)); g_assert(axWebView); - // Check table with both column and row headers - table = atk_object_ref_accessible_child(axWebView, 0); + /* Check table with both column and row headers. */ + AtkObject* table = atk_object_ref_accessible_child(axWebView, 0); g_assert(table); g_assert(atk_object_get_role(table) == ATK_ROLE_TABLE); - colHeader = atk_table_get_column_header(ATK_TABLE(table), 0); + AtkObject* colHeader = atk_table_get_column_header(ATK_TABLE(table), 0); g_assert(colHeader); g_assert(atk_object_get_role(colHeader) == ATK_ROLE_TABLE_CELL); g_assert(atk_object_get_index_in_parent(colHeader) == 0); @@ -543,7 +482,7 @@ static void testWebkitAtkGetHeadersInTable(void) g_assert(atk_object_get_role(colHeader) == ATK_ROLE_TABLE_CELL); g_assert(atk_object_get_index_in_parent(colHeader) == 2); - rowHeader = atk_table_get_row_header(ATK_TABLE(table), 0); + AtkObject* rowHeader = atk_table_get_row_header(ATK_TABLE(table), 0); g_assert(rowHeader); g_assert(atk_object_get_role(rowHeader) == ATK_ROLE_TABLE_CELL); g_assert(atk_object_get_index_in_parent(rowHeader) == 0); @@ -565,7 +504,7 @@ static void testWebkitAtkGetHeadersInTable(void) g_object_unref(table); - // Check table with no headers at all + /* Check table with no headers at all. */ table = atk_object_ref_accessible_child(axWebView, 1); g_assert(table); g_assert(atk_object_get_role(table) == ATK_ROLE_TABLE); @@ -588,8 +527,7 @@ static void testWebkitAtkGetHeadersInTable(void) static gint compAtkAttribute(AtkAttribute* a1, AtkAttribute* a2) { - gint strcmpVal; - strcmpVal = g_strcmp0(a1->name, a2->name); + gint strcmpVal = g_strcmp0(a1->name, a2->name); if (strcmpVal) return strcmpVal; return g_strcmp0(a1->value, a2->value); @@ -602,10 +540,9 @@ static gint compAtkAttributeName(AtkAttribute* a1, AtkAttribute* a2) static gboolean atkAttributeSetAttributeNameHasValue(AtkAttributeSet* set, const gchar* attributeName, const gchar* value) { - GSList* element; AtkAttribute at; at.name = (gchar*)attributeName; - element = g_slist_find_custom(set, &at, (GCompareFunc)compAtkAttributeName); + GSList* element = g_slist_find_custom(set, &at, (GCompareFunc)compAtkAttributeName); return element && !g_strcmp0(((AtkAttribute*)(element->data))->value, value); } @@ -640,52 +577,42 @@ static gboolean atkAttributeSetAreEqual(AtkAttributeSet* set1, AtkAttributeSet* return (!set2); } -static void testWebkitAtkTextAttributes(void) +static void testWebkitAtkTextAttributes() { - WebKitWebView* webView; - AtkObject* obj; - AtkObject* child; - GMainLoop* loop; - AtkText* childText; - AtkAttributeSet* set1; - AtkAttributeSet* set2; - AtkAttributeSet* set3; - AtkAttributeSet* set4; - gint startOffset, endOffset; - - webView = WEBKIT_WEB_VIEW(webkit_web_view_new()); + WebKitWebView* webView = WEBKIT_WEB_VIEW(webkit_web_view_new()); g_object_ref_sink(webView); - GtkAllocation alloc = { 0, 0, 800, 600 }; - gtk_widget_size_allocate(GTK_WIDGET(webView), &alloc); - - webkit_web_view_load_string(webView, textWithAttributes, NULL, NULL, NULL); - loop = g_main_loop_new(NULL, TRUE); + GtkAllocation allocation = { 0, 0, 800, 600 }; + gtk_widget_size_allocate(GTK_WIDGET(webView), &allocation); + webkit_web_view_load_string(webView, textWithAttributes, 0, 0, 0); - g_idle_add((GSourceFunc)bail_out, loop); - g_main_loop_run(loop); + /* Wait for the accessible objects to be created. */ + waitForAccessibleObjects(); - obj = gtk_widget_get_accessible(GTK_WIDGET(webView)); - g_assert(obj); + AtkObject* object = gtk_widget_get_accessible(GTK_WIDGET(webView)); + g_assert(object); - child = atk_object_ref_accessible_child(obj, 0); + AtkObject* child = atk_object_ref_accessible_child(object, 0); g_assert(child && ATK_IS_TEXT(child)); - childText = ATK_TEXT(child); - set1 = atk_text_get_run_attributes(childText, 0, &startOffset, &endOffset); + AtkText* childText = ATK_TEXT(child); + + gint startOffset; + gint endOffset; + AtkAttributeSet* set1 = atk_text_get_run_attributes(childText, 0, &startOffset, &endOffset); g_assert_cmpint(startOffset, ==, 0); g_assert_cmpint(endOffset, ==, 12); - g_assert(atkAttributeSetAreEqual(set1, NULL)); + g_assert(atkAttributeSetAreEqual(set1, 0)); - set2 = atk_text_get_run_attributes(childText, 15, &startOffset, &endOffset); + AtkAttributeSet* set2 = atk_text_get_run_attributes(childText, 15, &startOffset, &endOffset); g_assert_cmpint(startOffset, ==, 12); g_assert_cmpint(endOffset, ==, 17); g_assert(atkAttributeSetAttributeHasValue(set2, ATK_TEXT_ATTR_STYLE, "italic")); - set3 = atk_text_get_run_attributes(childText, 17, &startOffset, &endOffset); + AtkAttributeSet* set3 = atk_text_get_run_attributes(childText, 17, &startOffset, &endOffset); g_assert_cmpint(startOffset, ==, 17); g_assert_cmpint(endOffset, ==, 40); g_assert(atkAttributeSetAttributeHasValue(set3, ATK_TEXT_ATTR_WEIGHT, "700")); - set4 = atk_text_get_default_attributes(childText); + AtkAttributeSet* set4 = atk_text_get_default_attributes(childText); g_assert(atkAttributeSetAttributeHasValue(set4, ATK_TEXT_ATTR_STYLE, "normal")); g_assert(atkAttributeSetAttributeHasValue(set4, ATK_TEXT_ATTR_JUSTIFICATION, "right")); g_assert(atkAttributeSetAttributeHasValue(set4, ATK_TEXT_ATTR_SIZE, "14")); @@ -694,7 +621,7 @@ static void testWebkitAtkTextAttributes(void) atk_attribute_set_free(set3); atk_attribute_set_free(set4); - child = atk_object_ref_accessible_child(obj, 1); + child = atk_object_ref_accessible_child(object, 1); g_assert(child && ATK_IS_TEXT(child)); childText = ATK_TEXT(child); @@ -708,14 +635,14 @@ static void testWebkitAtkTextAttributes(void) set2 = atk_text_get_run_attributes(childText, 43, &startOffset, &endOffset); g_assert_cmpint(startOffset, ==, 43); g_assert_cmpint(endOffset, ==, 80); - // Checks that default attributes of text are not returned when called to atk_text_get_run_attributes + /* Checks that default attributes of text are not returned when called to atk_text_get_run_attributes. */ g_assert(!atkAttributeSetAttributeHasValue(set2, ATK_TEXT_ATTR_FG_COLOR, "120,121,122")); g_assert(atkAttributeSetAttributeHasValue(set2, ATK_TEXT_ATTR_UNDERLINE, "single")); g_assert(atkAttributeSetAttributeHasValue(set2, ATK_TEXT_ATTR_BG_COLOR, "80,81,82")); atk_attribute_set_free(set1); atk_attribute_set_free(set2); - child = atk_object_ref_accessible_child(obj, 2); + child = atk_object_ref_accessible_child(object, 2); g_assert(child && ATK_IS_TEXT(child)); childText = ATK_TEXT(child); @@ -740,7 +667,7 @@ static void testWebkitAtkTextAttributes(void) atk_attribute_set_free(set3); atk_attribute_set_free(set4); - child = atk_object_ref_accessible_child(obj, 3); + child = atk_object_ref_accessible_child(object, 3); g_assert(child && ATK_IS_TEXT(child)); childText = ATK_TEXT(child); set1 = atk_text_get_run_attributes(childText, 24, &startOffset, &endOffset); @@ -751,7 +678,7 @@ static void testWebkitAtkTextAttributes(void) set2 = atk_text_get_run_attributes(childText, 25, &startOffset, &endOffset); g_assert_cmpint(startOffset, ==, 25); g_assert_cmpint(endOffset, ==, 30); - g_assert(atkAttributeSetAreEqual(set2, NULL)); + g_assert(atkAttributeSetAreEqual(set2, 0)); set3 = atk_text_get_default_attributes(childText); g_assert(atkAttributeSetAttributeHasValue(set3, ATK_TEXT_ATTR_JUSTIFICATION, "center")); @@ -760,53 +687,49 @@ static void testWebkitAtkTextAttributes(void) atk_attribute_set_free(set3); } -static void testWekitAtkTextSelections(void) +static void testWebkitAtkTextSelections() { - WebKitWebView* webView; - AtkObject* obj; - GMainLoop* loop; - gchar* selectedText; - gint startOffset; - gint endOffset; - gboolean result; - - webView = WEBKIT_WEB_VIEW(webkit_web_view_new()); + WebKitWebView* webView = WEBKIT_WEB_VIEW(webkit_web_view_new()); g_object_ref_sink(webView); - GtkAllocation alloc = { 0, 0, 800, 600 }; - gtk_widget_size_allocate(GTK_WIDGET(webView), &alloc); - webkit_web_view_load_string(webView, textForSelections, NULL, NULL, NULL); - loop = g_main_loop_new(NULL, TRUE); + GtkAllocation allocation = { 0, 0, 800, 600 }; + gtk_widget_size_allocate(GTK_WIDGET(webView), &allocation); + webkit_web_view_load_string(webView, textForSelections, 0, 0, 0); - g_idle_add((GSourceFunc)bail_out, loop); - g_main_loop_run(loop); + /* Wait for the accessible objects to be created. */ + waitForAccessibleObjects(); - obj = gtk_widget_get_accessible(GTK_WIDGET(webView)); - g_assert(obj); + AtkObject* object = gtk_widget_get_accessible(GTK_WIDGET(webView)); + g_assert(object); - AtkText* paragraph1 = ATK_TEXT(atk_object_ref_accessible_child(obj, 0)); + AtkText* paragraph1 = ATK_TEXT(atk_object_ref_accessible_child(object, 0)); g_assert(ATK_IS_TEXT(paragraph1)); - AtkText* paragraph2 = ATK_TEXT(atk_object_ref_accessible_child(obj, 1)); + AtkText* paragraph2 = ATK_TEXT(atk_object_ref_accessible_child(object, 1)); g_assert(ATK_IS_TEXT(paragraph2)); AtkText* link = ATK_TEXT(atk_object_ref_accessible_child(ATK_OBJECT(paragraph2), 0)); g_assert(ATK_IS_TEXT(link)); - // First paragraph (simple text) + /* First paragraph (simple text). */ - // Basic initial checks + /* Basic initial checks. */ g_assert_cmpint(atk_text_get_n_selections(paragraph1), ==, 0); - selectedText = atk_text_get_selection(paragraph1, 0, &startOffset, &endOffset); + + gint startOffset; + gint endOffset; + gchar* selectedText = atk_text_get_selection(paragraph1, 0, &startOffset, &endOffset); g_assert_cmpint(startOffset, ==, 0); g_assert_cmpint(endOffset, ==, 0); - g_assert_cmpstr(selectedText, ==, NULL); + g_assert_cmpstr(selectedText, ==, 0); g_free (selectedText); - // Try removing a non existing (yet) selection - result = atk_text_remove_selection(paragraph1, 0); + + /* Try removing a non existing (yet) selection. */ + gboolean result = atk_text_remove_selection(paragraph1, 0); g_assert(!result); - // Try setting a 0-char selection + + /* Try setting a 0-char selection. */ result = atk_text_set_selection(paragraph1, 0, 5, 5); g_assert(result); - // Make a selection and test it + /* Make a selection and test it. */ result = atk_text_set_selection(paragraph1, 0, 5, 25); g_assert(result); g_assert_cmpint(atk_text_get_n_selections(paragraph1), ==, 1); @@ -815,29 +738,29 @@ static void testWekitAtkTextSelections(void) g_assert_cmpint(endOffset, ==, 25); g_assert_cmpstr(selectedText, ==, "agraph with plain te"); g_free (selectedText); - // Try removing the selection from other AtkText object (should fail) + /* Try removing the selection from other AtkText object (should fail). */ result = atk_text_remove_selection(paragraph2, 0); g_assert(!result); - // Remove the selection and test everything again + /* Remove the selection and test everything again. */ result = atk_text_remove_selection(paragraph1, 0); g_assert(result); g_assert_cmpint(atk_text_get_n_selections(paragraph1), ==, 0); selectedText = atk_text_get_selection(paragraph1, 0, &startOffset, &endOffset); - // Now offsets should be the same, set to the last position of the caret + /* Now offsets should be the same, set to the last position of the caret. */ g_assert_cmpint(startOffset, ==, endOffset); g_assert_cmpint(startOffset, ==, 25); g_assert_cmpint(endOffset, ==, 25); - g_assert_cmpstr(selectedText, ==, NULL); + g_assert_cmpstr(selectedText, ==, 0); g_free (selectedText); - // Second paragraph (text + link + text) + /* Second paragraph (text + link + text). */ - // Set a selection partially covering the link and test it + /* Set a selection partially covering the link and test it. */ result = atk_text_set_selection(paragraph2, 0, 7, 21); g_assert(result); - // Test the paragraph first + /* Test the paragraph first. */ g_assert_cmpint(atk_text_get_n_selections(paragraph2), ==, 1); selectedText = atk_text_get_selection(paragraph2, 0, &startOffset, &endOffset); g_assert_cmpint(startOffset, ==, 7); @@ -845,7 +768,7 @@ static void testWekitAtkTextSelections(void) g_assert_cmpstr(selectedText, ==, "raph with a li"); g_free (selectedText); - // Now test just the link + /* Now test just the link. */ g_assert_cmpint(atk_text_get_n_selections(link), ==, 1); selectedText = atk_text_get_selection(link, 0, &startOffset, &endOffset); g_assert_cmpint(startOffset, ==, 0); @@ -853,21 +776,21 @@ static void testWekitAtkTextSelections(void) g_assert_cmpstr(selectedText, ==, "a li"); g_free (selectedText); - // Remove selections and text everything again + /* Remove selections and text everything again. */ result = atk_text_remove_selection(paragraph2, 0); g_assert(result); g_assert_cmpint(atk_text_get_n_selections(paragraph2), ==, 0); selectedText = atk_text_get_selection(paragraph2, 0, &startOffset, &endOffset); - // Now offsets should be the same (no selection) + /* Now offsets should be the same (no selection). */ g_assert_cmpint(startOffset, ==, endOffset); - g_assert_cmpstr(selectedText, ==, NULL); + g_assert_cmpstr(selectedText, ==, 0); g_free (selectedText); g_assert_cmpint(atk_text_get_n_selections(link), ==, 0); selectedText = atk_text_get_selection(link, 0, &startOffset, &endOffset); - // Now offsets should be the same (no selection) + /* Now offsets should be the same (no selection). */ g_assert_cmpint(startOffset, ==, endOffset); - g_assert_cmpstr(selectedText, ==, NULL); + g_assert_cmpstr(selectedText, ==, 0); g_free (selectedText); g_object_unref(paragraph1); @@ -875,136 +798,133 @@ static void testWekitAtkTextSelections(void) g_object_unref(webView); } -static void testWebkitAtkGetExtents(void) +static void testWebkitAtkGetExtents() { - WebKitWebView* webView; - AtkObject* obj; - GMainLoop* loop; - - webView = WEBKIT_WEB_VIEW(webkit_web_view_new()); + WebKitWebView* webView = WEBKIT_WEB_VIEW(webkit_web_view_new()); g_object_ref_sink(webView); - GtkAllocation alloc = { 0, 0, 800, 600 }; - gtk_widget_size_allocate(GTK_WIDGET(webView), &alloc); - webkit_web_view_load_string(webView, centeredContents, NULL, NULL, NULL); - loop = g_main_loop_new(NULL, TRUE); - - g_idle_add((GSourceFunc)bail_out, loop); - g_main_loop_run(loop); - - obj = gtk_widget_get_accessible(GTK_WIDGET(webView)); - g_assert(obj); - - AtkText* short_text1 = ATK_TEXT(atk_object_ref_accessible_child(obj, 0)); - g_assert(ATK_IS_TEXT(short_text1)); - AtkText* long_text = ATK_TEXT(atk_object_ref_accessible_child(obj, 1)); - g_assert(ATK_IS_TEXT(long_text)); - AtkText* short_text2 = ATK_TEXT(atk_object_ref_accessible_child(obj, 2)); - g_assert(ATK_IS_TEXT(short_text2)); - AtkText* multiline_text = ATK_TEXT(atk_object_ref_accessible_child(obj, 3)); - g_assert(ATK_IS_TEXT(multiline_text)); - - // Start with window extents. + GtkAllocation allocation = { 0, 0, 800, 600 }; + gtk_widget_size_allocate(GTK_WIDGET(webView), &allocation); + webkit_web_view_load_string(webView, centeredContents, 0, 0, 0); + + /* Wait for the accessible objects to be created. */ + waitForAccessibleObjects(); + + AtkObject* object = gtk_widget_get_accessible(GTK_WIDGET(webView)); + g_assert(object); + + AtkText* shortText1 = ATK_TEXT(atk_object_ref_accessible_child(object, 0)); + g_assert(ATK_IS_TEXT(shortText1)); + AtkText* longText = ATK_TEXT(atk_object_ref_accessible_child(object, 1)); + g_assert(ATK_IS_TEXT(longText)); + AtkText* shortText2 = ATK_TEXT(atk_object_ref_accessible_child(object, 2)); + g_assert(ATK_IS_TEXT(shortText2)); + AtkText* multilineText = ATK_TEXT(atk_object_ref_accessible_child(object, 3)); + g_assert(ATK_IS_TEXT(multilineText)); + + /* Start with window extents. */ AtkTextRectangle sline_window1, sline_window2, lline_window, mline_window; - atk_text_get_range_extents(short_text1, 0, 10, ATK_XY_WINDOW, &sline_window1); - atk_text_get_range_extents(long_text, 0, 44, ATK_XY_WINDOW, &lline_window); - atk_text_get_range_extents(short_text2, 0, 10, ATK_XY_WINDOW, &sline_window2); - atk_text_get_range_extents(multiline_text, 0, 60, ATK_XY_WINDOW, &mline_window); + atk_text_get_range_extents(shortText1, 0, 10, ATK_XY_WINDOW, &sline_window1); + atk_text_get_range_extents(longText, 0, 44, ATK_XY_WINDOW, &lline_window); + atk_text_get_range_extents(shortText2, 0, 10, ATK_XY_WINDOW, &sline_window2); + atk_text_get_range_extents(multilineText, 0, 60, ATK_XY_WINDOW, &mline_window); - // Check vertical line position. + /* Check vertical line position. */ g_assert_cmpint(sline_window1.y + sline_window1.height, <=, lline_window.y); g_assert_cmpint(lline_window.y + lline_window.height + sline_window2.height, <=, mline_window.y); - // Paragraphs 1 and 3 have identical text and alignment. + /* Paragraphs 1 and 3 have identical text and alignment. */ g_assert_cmpint(sline_window1.x, ==, sline_window2.x); g_assert_cmpint(sline_window1.width, ==, sline_window2.width); g_assert_cmpint(sline_window1.height, ==, sline_window2.height); - // All lines should be the same height; line 2 is the widest line. + /* All lines should be the same height; line 2 is the widest line. */ g_assert_cmpint(sline_window1.height, ==, lline_window.height); g_assert_cmpint(sline_window1.width, <, lline_window.width); - // Make sure the character extents jive with the range extents. - gint x, y, width, height; + /* Make sure the character extents jive with the range extents. */ + gint x; + gint y; + gint width; + gint height; - // First paragraph (short text) - atk_text_get_character_extents(short_text1, 0, &x, &y, &width, &height, ATK_XY_WINDOW); + /* First paragraph (short text). */ + atk_text_get_character_extents(shortText1, 0, &x, &y, &width, &height, ATK_XY_WINDOW); g_assert_cmpint(x, ==, sline_window1.x); g_assert_cmpint(y, ==, sline_window1.y); g_assert_cmpint(height, ==, sline_window1.height); - atk_text_get_character_extents(short_text1, 9, &x, &y, &width, &height, ATK_XY_WINDOW); + atk_text_get_character_extents(shortText1, 9, &x, &y, &width, &height, ATK_XY_WINDOW); g_assert_cmpint(x, ==, sline_window1.x + sline_window1.width - width); g_assert_cmpint(y, ==, sline_window1.y); g_assert_cmpint(height, ==, sline_window1.height); - // Second paragraph (long text) - atk_text_get_character_extents(long_text, 0, &x, &y, &width, &height, ATK_XY_WINDOW); + /* Second paragraph (long text). */ + atk_text_get_character_extents(longText, 0, &x, &y, &width, &height, ATK_XY_WINDOW); g_assert_cmpint(x, ==, lline_window.x); g_assert_cmpint(y, ==, lline_window.y); g_assert_cmpint(height, ==, lline_window.height); - atk_text_get_character_extents(long_text, 43, &x, &y, &width, &height, ATK_XY_WINDOW); + atk_text_get_character_extents(longText, 43, &x, &y, &width, &height, ATK_XY_WINDOW); g_assert_cmpint(x, ==, lline_window.x + lline_window.width - width); g_assert_cmpint(y, ==, lline_window.y); g_assert_cmpint(height, ==, lline_window.height); - // Third paragraph (short text) - atk_text_get_character_extents(short_text2, 0, &x, &y, &width, &height, ATK_XY_WINDOW); + /* Third paragraph (short text). */ + atk_text_get_character_extents(shortText2, 0, &x, &y, &width, &height, ATK_XY_WINDOW); g_assert_cmpint(x, ==, sline_window2.x); g_assert_cmpint(y, ==, sline_window2.y); g_assert_cmpint(height, ==, sline_window2.height); - atk_text_get_character_extents(short_text2, 9, &x, &y, &width, &height, ATK_XY_WINDOW); + atk_text_get_character_extents(shortText2, 9, &x, &y, &width, &height, ATK_XY_WINDOW); g_assert_cmpint(x, ==, sline_window2.x + sline_window2.width - width); g_assert_cmpint(y, ==, sline_window2.y); g_assert_cmpint(height, ==, sline_window2.height); - // Four paragraph (3 lines multi-line text) - atk_text_get_character_extents(multiline_text, 0, &x, &y, &width, &height, ATK_XY_WINDOW); + /* Four paragraph (3 lines multi-line text). */ + atk_text_get_character_extents(multilineText, 0, &x, &y, &width, &height, ATK_XY_WINDOW); g_assert_cmpint(x, ==, mline_window.x); g_assert_cmpint(y, ==, mline_window.y); g_assert_cmpint(3 * height, ==, mline_window.height); - atk_text_get_character_extents(multiline_text, 59, &x, &y, &width, &height, ATK_XY_WINDOW); - // Last line won't fill the whole width of the rectangle + atk_text_get_character_extents(multilineText, 59, &x, &y, &width, &height, ATK_XY_WINDOW); + /* Last line won't fill the whole width of the rectangle. */ g_assert_cmpint(x, <=, mline_window.x + mline_window.width - width); g_assert_cmpint(y, ==, mline_window.y + mline_window.height - height); g_assert_cmpint(height, <=, mline_window.height); - g_object_unref(short_text1); - g_object_unref(short_text2); - g_object_unref(long_text); - g_object_unref(multiline_text); + g_object_unref(shortText1); + g_object_unref(shortText2); + g_object_unref(longText); + g_object_unref(multilineText); g_object_unref(webView); } -static void testWebkitAtkLayoutAndDataTables(void) +static void testWebkitAtkLayoutAndDataTables() { WebKitWebView* webView = WEBKIT_WEB_VIEW(webkit_web_view_new()); g_object_ref_sink(webView); - GtkAllocation alloc = { 0, 0, 800, 600 }; - gtk_widget_size_allocate(GTK_WIDGET(webView), &alloc); + GtkAllocation allocation = { 0, 0, 800, 600 }; + gtk_widget_size_allocate(GTK_WIDGET(webView), &allocation); webkit_web_view_load_string(webView, layoutAndDataTables, 0, 0, 0); - // Manually spin the main context to get the accessible objects - while (g_main_context_pending(0)) - g_main_context_iteration(0, TRUE); + /* Wait for the accessible objects to be created. */ + waitForAccessibleObjects(); - AtkObject* obj = gtk_widget_get_accessible(GTK_WIDGET(webView)); - g_assert(obj); + AtkObject* object = gtk_widget_get_accessible(GTK_WIDGET(webView)); + g_assert(object); - // Check the non-layout table (data table) + /* Check the non-layout table (data table). */ - AtkObject* table1 = atk_object_ref_accessible_child(obj, 0); + AtkObject* table1 = atk_object_ref_accessible_child(object, 0); g_assert(ATK_IS_TABLE(table1)); AtkAttributeSet* set1 = atk_object_get_attributes(table1); g_assert(set1); g_assert(!atkAttributeSetContainsAttributeName(set1, "layout-guess")); atk_attribute_set_free(set1); - // Check the layout table + /* Check the layout table. */ - AtkObject* table2 = atk_object_ref_accessible_child(obj, 1); + AtkObject* table2 = atk_object_ref_accessible_child(object, 1); g_assert(ATK_IS_TABLE(table2)); AtkAttributeSet* set2 = atk_object_get_attributes(table2); g_assert(set2); @@ -1017,22 +937,21 @@ static void testWebkitAtkLayoutAndDataTables(void) g_object_unref(webView); } -static void testWebkitAtkLinksWithInlineImages(void) +static void testWebkitAtkLinksWithInlineImages() { WebKitWebView* webView = WEBKIT_WEB_VIEW(webkit_web_view_new()); g_object_ref_sink(webView); - GtkAllocation alloc = { 0, 0, 800, 600 }; - gtk_widget_size_allocate(GTK_WIDGET(webView), &alloc); + GtkAllocation allocation = { 0, 0, 800, 600 }; + gtk_widget_size_allocate(GTK_WIDGET(webView), &allocation); webkit_web_view_load_string(webView, linksWithInlineImages, 0, 0, 0); - // Manually spin the main context to get the accessible objects - while (g_main_context_pending(0)) - g_main_context_iteration(0, TRUE); + /* Wait for the accessible objects to be created. */ + waitForAccessibleObjects(); AtkObject* object = gtk_widget_get_accessible(GTK_WIDGET(webView)); g_assert(object); - // First paragraph (link at the beginning) + /* First paragraph (link at the beginning). */ AtkObject* paragraph = atk_object_ref_accessible_child(object, 0); g_assert(ATK_IS_TEXT(paragraph)); gint startOffset; @@ -1045,7 +964,7 @@ static void testWebkitAtkLinksWithInlineImages(void) g_free(text); g_object_unref(paragraph); - // Second paragraph (link in the middle) + /* Second paragraph (link in the middle). */ paragraph = atk_object_ref_accessible_child(object, 1); g_assert(ATK_IS_TEXT(paragraph)); text = atk_text_get_text_at_offset(ATK_TEXT(paragraph), 0, ATK_TEXT_BOUNDARY_LINE_START, &startOffset, &endOffset); @@ -1056,7 +975,7 @@ static void testWebkitAtkLinksWithInlineImages(void) g_free(text); g_object_unref(paragraph); - // Third paragraph (link at the end) + /* Third paragraph (link at the end). */ paragraph = atk_object_ref_accessible_child(object, 2); g_assert(ATK_IS_TEXT(paragraph)); text = atk_text_get_text_at_offset(ATK_TEXT(paragraph), 0, ATK_TEXT_BOUNDARY_LINE_START, &startOffset, &endOffset); @@ -1070,24 +989,97 @@ static void testWebkitAtkLinksWithInlineImages(void) g_object_unref(webView); } -static void testWebkitAtkListsOfItems(void) +static void testWebkitAtkHypertextAndHyperlinks() { WebKitWebView* webView = WEBKIT_WEB_VIEW(webkit_web_view_new()); g_object_ref_sink(webView); - GtkAllocation alloc = { 0, 0, 800, 600 }; - gtk_widget_size_allocate(GTK_WIDGET(webView), &alloc); - webkit_web_view_load_string(webView, listsOfItems, NULL, NULL, NULL); - GMainLoop* loop = g_main_loop_new(NULL, TRUE); + GtkAllocation allocation = { 0, 0, 800, 600 }; + gtk_widget_size_allocate(GTK_WIDGET(webView), &allocation); + webkit_web_view_load_string(webView, hypertextAndHyperlinks, 0, 0, 0); - g_idle_add((GSourceFunc)bail_out, loop); - g_main_loop_run(loop); + /* Wait for the accessible objects to be created. */ + waitForAccessibleObjects(); - AtkObject* obj = gtk_widget_get_accessible(GTK_WIDGET(webView)); - g_assert(obj); + AtkObject* object = gtk_widget_get_accessible(GTK_WIDGET(webView)); + g_assert(object); - // Unordered list + AtkObject* paragraph1 = atk_object_ref_accessible_child(object, 0); + g_assert(ATK_OBJECT(paragraph1)); + g_assert(atk_object_get_role(paragraph1) == ATK_ROLE_PARAGRAPH); + g_assert(ATK_IS_HYPERTEXT(paragraph1)); + + /* No links in the first paragraph. */ + gint nLinks = atk_hypertext_get_n_links(ATK_HYPERTEXT(paragraph1)); + g_assert_cmpint(nLinks, ==, 0); + + AtkObject* paragraph2 = atk_object_ref_accessible_child(object, 1); + g_assert(ATK_OBJECT(paragraph2)); + g_assert(atk_object_get_role(paragraph2) == ATK_ROLE_PARAGRAPH); + g_assert(ATK_IS_HYPERTEXT(paragraph2)); + + /* Check links in the second paragraph. + nLinks = atk_hypertext_get_n_links(ATK_HYPERTEXT(paragraph2)); + g_assert_cmpint(nLinks, ==, 3); */ + + AtkHyperlink* hLink1 = atk_hypertext_get_link(ATK_HYPERTEXT(paragraph2), 0); + g_assert(ATK_HYPERLINK(hLink1)); + AtkObject* hLinkObject1 = atk_hyperlink_get_object(hLink1, 0); + g_assert(ATK_OBJECT(hLinkObject1)); + g_assert(atk_object_get_role(hLinkObject1) == ATK_ROLE_LINK); + g_assert_cmpint(atk_hyperlink_get_start_index(hLink1), ==, 0); + g_assert_cmpint(atk_hyperlink_get_end_index(hLink1), ==, 6); + g_assert_cmpint(atk_hyperlink_get_n_anchors(hLink1), ==, 1); + g_assert_cmpstr(atk_hyperlink_get_uri(hLink1, 0), ==, "http://foo.bar.baz/"); + + AtkHyperlink* hLink2 = atk_hypertext_get_link(ATK_HYPERTEXT(paragraph2), 1); + g_assert(ATK_HYPERLINK(hLink2)); + AtkObject* hLinkObject2 = atk_hyperlink_get_object(hLink2, 0); + g_assert(ATK_OBJECT(hLinkObject2)); + g_assert(atk_object_get_role(hLinkObject2) == ATK_ROLE_LINK); + g_assert_cmpint(atk_hyperlink_get_start_index(hLink2), ==, 12); + g_assert_cmpint(atk_hyperlink_get_end_index(hLink2), ==, 32); + g_assert_cmpint(atk_hyperlink_get_n_anchors(hLink2), ==, 1); + g_assert_cmpstr(atk_hyperlink_get_uri(hLink2, 0), ==, "http://bar.baz.foo/"); + + AtkHyperlink* hLink3 = atk_hypertext_get_link(ATK_HYPERTEXT(paragraph2), 2); + g_assert(ATK_HYPERLINK(hLink3)); + AtkObject* hLinkObject3 = atk_hyperlink_get_object(hLink3, 0); + g_assert(ATK_OBJECT(hLinkObject3)); + g_assert(atk_object_get_role(hLinkObject3) == ATK_ROLE_LINK); + g_assert_cmpint(atk_hyperlink_get_start_index(hLink3), ==, 65); + g_assert_cmpint(atk_hyperlink_get_end_index(hLink3), ==, 75); + g_assert_cmpint(atk_hyperlink_get_n_anchors(hLink3), ==, 1); + g_assert_cmpstr(atk_hyperlink_get_uri(hLink3, 0), ==, "http://baz.foo.bar/"); + + /* Finally check the AtkAction interface for a given AtkHyperlink. */ + g_assert(ATK_IS_ACTION(hLink1)); + g_assert_cmpint(atk_action_get_n_actions(ATK_ACTION(hLink1)), ==, 1); + g_assert_cmpstr(atk_action_get_keybinding(ATK_ACTION(hLink1), 0), ==, ""); + g_assert_cmpstr(atk_action_get_name(ATK_ACTION(hLink1), 0), ==, "jump"); + g_assert(atk_action_do_action(ATK_ACTION(hLink1), 0)); - AtkObject* uList = atk_object_ref_accessible_child(obj, 0); + g_object_unref(paragraph1); + g_object_unref(paragraph2); + g_object_unref(webView); +} + +static void testWebkitAtkListsOfItems() +{ + WebKitWebView* webView = WEBKIT_WEB_VIEW(webkit_web_view_new()); + g_object_ref_sink(webView); + GtkAllocation allocation = { 0, 0, 800, 600 }; + gtk_widget_size_allocate(GTK_WIDGET(webView), &allocation); + webkit_web_view_load_string(webView, listsOfItems, 0, 0, 0); + + /* Wait for the accessible objects to be created. */ + waitForAccessibleObjects(); + + AtkObject* object = gtk_widget_get_accessible(GTK_WIDGET(webView)); + g_assert(object); + + /* Unordered list. */ + + AtkObject* uList = atk_object_ref_accessible_child(object, 0); g_assert(ATK_OBJECT(uList)); g_assert(atk_object_get_role(uList) == ATK_ROLE_LIST); g_assert_cmpint(atk_object_get_n_accessible_children(uList), ==, 3); @@ -1111,9 +1103,9 @@ static void testWebkitAtkListsOfItems(void) g_object_unref(item2); g_object_unref(item3); - // Ordered list + /* Ordered list. */ - AtkObject* oList = atk_object_ref_accessible_child(obj, 1); + AtkObject* oList = atk_object_ref_accessible_child(object, 1); g_assert(ATK_OBJECT(oList)); g_assert(atk_object_get_role(oList) == ATK_ROLE_LIST); g_assert_cmpint(atk_object_get_n_accessible_children(oList), ==, 3); @@ -1162,22 +1154,21 @@ static gboolean checkTextChanges(gpointer unused) return FALSE; } -static void testWebkitAtkTextChangedNotifications(void) +static void testWebkitAtkTextChangedNotifications() { WebKitWebView* webView = WEBKIT_WEB_VIEW(webkit_web_view_new()); g_object_ref_sink(webView); - GtkAllocation alloc = { 0, 0, 800, 600 }; - gtk_widget_size_allocate(GTK_WIDGET(webView), &alloc); + GtkAllocation allocation = { 0, 0, 800, 600 }; + gtk_widget_size_allocate(GTK_WIDGET(webView), &allocation); webkit_web_view_load_string(webView, formWithTextInputs, 0, 0, 0); - // Manually spin the main context to get the accessible objects - while (g_main_context_pending(0)) - g_main_context_iteration(0, TRUE); + /* Wait for the accessible objects to be created. */ + waitForAccessibleObjects(); - AtkObject* obj = gtk_widget_get_accessible(GTK_WIDGET(webView)); - g_assert(obj); + AtkObject* object = gtk_widget_get_accessible(GTK_WIDGET(webView)); + g_assert(object); - AtkObject* form = atk_object_ref_accessible_child(obj, 0); + AtkObject* form = atk_object_ref_accessible_child(object, 0); g_assert(ATK_IS_OBJECT(form)); AtkObject* textEntry = atk_object_ref_accessible_child(form, 0); @@ -1206,22 +1197,23 @@ static void testWebkitAtkTextChangedNotifications(void) int main(int argc, char** argv) { - g_thread_init(NULL); - gtk_test_init(&argc, &argv, NULL); + g_thread_init(0); + gtk_test_init(&argc, &argv, 0); g_test_bug_base("https://bugs.webkit.org/"); - g_test_add_func("/webkit/atk/get_text_at_offset", test_webkit_atk_get_text_at_offset); - g_test_add_func("/webkit/atk/get_text_at_offset_forms", test_webkit_atk_get_text_at_offset_forms); - g_test_add_func("/webkit/atk/get_text_at_offset_newlines", test_webkit_atk_get_text_at_offset_newlines); - g_test_add_func("/webkit/atk/get_text_at_offset_textarea", test_webkit_atk_get_text_at_offset_textarea); - g_test_add_func("/webkit/atk/get_text_at_offset_text_input", test_webkit_atk_get_text_at_offset_text_input); + g_test_add_func("/webkit/atk/getTextAtOffset", testWebkitAtkGetTextAtOffset); + g_test_add_func("/webkit/atk/getTextAtOffsetForms", testWebkitAtkGetTextAtOffsetForms); + g_test_add_func("/webkit/atk/getTextAtOffsetNewlines", testWebkitAtkGetTextAtOffsetNewlines); + g_test_add_func("/webkit/atk/getTextAtOffsetTextarea", testWebkitAtkGetTextAtOffsetTextarea); + g_test_add_func("/webkit/atk/getTextAtOffsetTextInput", testWebkitAtkGetTextAtOffsetTextInput); g_test_add_func("/webkit/atk/getTextInParagraphAndBodySimple", testWebkitAtkGetTextInParagraphAndBodySimple); g_test_add_func("/webkit/atk/getTextInParagraphAndBodyModerate", testWebkitAtkGetTextInParagraphAndBodyModerate); g_test_add_func("/webkit/atk/getTextInTable", testWebkitAtkGetTextInTable); g_test_add_func("/webkit/atk/getHeadersInTable", testWebkitAtkGetHeadersInTable); g_test_add_func("/webkit/atk/textAttributes", testWebkitAtkTextAttributes); - g_test_add_func("/webkit/atk/textSelections", testWekitAtkTextSelections); + g_test_add_func("/webkit/atk/textSelections", testWebkitAtkTextSelections); g_test_add_func("/webkit/atk/getExtents", testWebkitAtkGetExtents); + g_test_add_func("/webkit/atk/hypertextAndHyperlinks", testWebkitAtkHypertextAndHyperlinks); g_test_add_func("/webkit/atk/layoutAndDataTables", testWebkitAtkLayoutAndDataTables); g_test_add_func("/webkit/atk/linksWithInlineImages", testWebkitAtkLinksWithInlineImages); g_test_add_func("/webkit/atk/listsOfItems", testWebkitAtkListsOfItems); |