|
Lines 50-55
static const char* contentsWithExtraneousWhiteSpaces = "<html><head><body><p>Thi
a/Source/WebKit/gtk/tests/testatk.c_sec1
|
| 50 |
|
50 |
|
| 51 |
static const char* comboBoxSelector = "<html><body><select><option selected value='foo'>foo</option><option value='bar'>bar</option></select></body></html>"; |
51 |
static const char* comboBoxSelector = "<html><body><select><option selected value='foo'>foo</option><option value='bar'>bar</option></select></body></html>"; |
| 52 |
|
52 |
|
|
|
53 |
static const char* embeddedObjects = "<html><body><p>Choose: <input value='foo' type='checkbox'/>foo <input value='bar' type='checkbox'/>bar (pick one)</p><p>Choose: <select name='foo'><option>bar</option><option>baz</option></select> (pick one)</p><p><input name='foobarbutton' value='foobar' type='button'/></p></body></html>"; |
| 54 |
|
| 53 |
static const char* formWithTextInputs = "<html><body><form><input type='text' name='entry' /></form></body></html>"; |
55 |
static const char* formWithTextInputs = "<html><body><form><input type='text' name='entry' /></form></body></html>"; |
| 54 |
|
56 |
|
| 55 |
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><ol><li>List item with a <span><a href='http://foo.bar.baz/'>link inside a span node</a></span></li></ol></body></html>"; |
57 |
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><ol><li>List item with a <span><a href='http://foo.bar.baz/'>link inside a span node</a></span></li></ol></body></html>"; |
|
Lines 480-485
static void testWebkitAtkComboBox()
a/Source/WebKit/gtk/tests/testatk.c_sec2
|
| 480 |
g_object_unref(webView); |
482 |
g_object_unref(webView); |
| 481 |
} |
483 |
} |
| 482 |
|
484 |
|
|
|
485 |
static void testWebkitAtkEmbeddedObjects() |
| 486 |
{ |
| 487 |
WebKitWebView* webView = WEBKIT_WEB_VIEW(webkit_web_view_new()); |
| 488 |
g_object_ref_sink(webView); |
| 489 |
GtkAllocation allocation = { 0, 0, 800, 600 }; |
| 490 |
gtk_widget_size_allocate(GTK_WIDGET(webView), &allocation); |
| 491 |
webkit_web_view_load_string(webView, embeddedObjects, 0, 0, 0); |
| 492 |
|
| 493 |
/* Wait for the accessible objects to be created. */ |
| 494 |
waitForAccessibleObjects(); |
| 495 |
|
| 496 |
AtkObject* object = gtk_widget_get_accessible(GTK_WIDGET(webView)); |
| 497 |
g_assert(object); |
| 498 |
|
| 499 |
AtkText* paragraph1 = ATK_TEXT(atk_object_ref_accessible_child(object, 0)); |
| 500 |
g_assert(ATK_IS_TEXT(paragraph1)); |
| 501 |
g_assert(ATK_IS_HYPERTEXT(paragraph1)); |
| 502 |
|
| 503 |
const gchar* expectedText = "Choose: \357\277\274foo \357\277\274bar (pick one)"; |
| 504 |
char* text = atk_text_get_text(paragraph1, 0, -1); |
| 505 |
g_assert_cmpstr(text, ==, expectedText); |
| 506 |
g_free(text); |
| 507 |
|
| 508 |
gint nLinks = atk_hypertext_get_n_links(ATK_HYPERTEXT(paragraph1)); |
| 509 |
g_assert_cmpint(nLinks, ==, 2); |
| 510 |
|
| 511 |
AtkHyperlink* hLink = atk_hypertext_get_link(ATK_HYPERTEXT(paragraph1), 0); |
| 512 |
g_assert(ATK_HYPERLINK(hLink)); |
| 513 |
AtkObject* hLinkObject = atk_hyperlink_get_object(hLink, 0); |
| 514 |
g_assert(ATK_OBJECT(hLinkObject)); |
| 515 |
g_assert(atk_object_get_role(hLinkObject) == ATK_ROLE_CHECK_BOX); |
| 516 |
g_assert_cmpint(atk_hyperlink_get_start_index(hLink), ==, 8); |
| 517 |
g_assert_cmpint(atk_hyperlink_get_end_index(hLink), ==, 9); |
| 518 |
g_assert_cmpint(atk_hyperlink_get_n_anchors(hLink), ==, 1); |
| 519 |
g_assert_cmpstr(atk_hyperlink_get_uri(hLink, 0), ==, 0); |
| 520 |
|
| 521 |
AtkText* paragraph2 = ATK_TEXT(atk_object_ref_accessible_child(object, 1)); |
| 522 |
g_assert(ATK_IS_TEXT(paragraph2)); |
| 523 |
g_assert(ATK_IS_HYPERTEXT(paragraph2)); |
| 524 |
|
| 525 |
expectedText = "Choose: \357\277\274 (pick one)"; |
| 526 |
text = atk_text_get_text(paragraph2, 0, -1); |
| 527 |
g_assert_cmpstr(text, ==, expectedText); |
| 528 |
g_free(text); |
| 529 |
|
| 530 |
nLinks = atk_hypertext_get_n_links(ATK_HYPERTEXT(paragraph2)); |
| 531 |
g_assert_cmpint(nLinks, ==, 1); |
| 532 |
|
| 533 |
hLink = atk_hypertext_get_link(ATK_HYPERTEXT(paragraph2), 0); |
| 534 |
g_assert(ATK_HYPERLINK(hLink)); |
| 535 |
hLinkObject = atk_hyperlink_get_object(hLink, 0); |
| 536 |
g_assert(ATK_OBJECT(hLinkObject)); |
| 537 |
g_assert(atk_object_get_role(hLinkObject) == ATK_ROLE_COMBO_BOX); |
| 538 |
g_assert_cmpint(atk_hyperlink_get_start_index(hLink), ==, 8); |
| 539 |
g_assert_cmpint(atk_hyperlink_get_end_index(hLink), ==, 9); |
| 540 |
g_assert_cmpint(atk_hyperlink_get_n_anchors(hLink), ==, 1); |
| 541 |
g_assert_cmpstr(atk_hyperlink_get_uri(hLink, 0), ==, 0); |
| 542 |
|
| 543 |
AtkText* paragraph3 = ATK_TEXT(atk_object_ref_accessible_child(object, 2)); |
| 544 |
g_assert(ATK_IS_TEXT(paragraph3)); |
| 545 |
g_assert(ATK_IS_HYPERTEXT(paragraph3)); |
| 546 |
|
| 547 |
expectedText = "\357\277\274"; |
| 548 |
text = atk_text_get_text(paragraph3, 0, -1); |
| 549 |
g_assert_cmpstr(text, ==, expectedText); |
| 550 |
g_free(text); |
| 551 |
|
| 552 |
nLinks = atk_hypertext_get_n_links(ATK_HYPERTEXT(paragraph3)); |
| 553 |
g_assert_cmpint(nLinks, ==, 1); |
| 554 |
|
| 555 |
hLink = atk_hypertext_get_link(ATK_HYPERTEXT(paragraph3), 0); |
| 556 |
g_assert(ATK_HYPERLINK(hLink)); |
| 557 |
hLinkObject = atk_hyperlink_get_object(hLink, 0); |
| 558 |
g_assert(ATK_OBJECT(hLinkObject)); |
| 559 |
g_assert(atk_object_get_role(hLinkObject) == ATK_ROLE_PUSH_BUTTON); |
| 560 |
g_assert_cmpint(atk_hyperlink_get_start_index(hLink), ==, 0); |
| 561 |
g_assert_cmpint(atk_hyperlink_get_end_index(hLink), ==, 1); |
| 562 |
g_assert_cmpint(atk_hyperlink_get_n_anchors(hLink), ==, 1); |
| 563 |
g_assert_cmpstr(atk_hyperlink_get_uri(hLink, 0), ==, 0); |
| 564 |
|
| 565 |
g_object_unref(paragraph1); |
| 566 |
g_object_unref(paragraph2); |
| 567 |
g_object_unref(paragraph3); |
| 568 |
g_object_unref(webView); |
| 569 |
} |
| 570 |
|
| 483 |
static void testWebkitAtkGetTextAtOffsetForms() |
571 |
static void testWebkitAtkGetTextAtOffsetForms() |
| 484 |
{ |
572 |
{ |
| 485 |
WebKitWebView* webView = WEBKIT_WEB_VIEW(webkit_web_view_new()); |
573 |
WebKitWebView* webView = WEBKIT_WEB_VIEW(webkit_web_view_new()); |
|
Lines 1579-1584
int main(int argc, char** argv)
a/Source/WebKit/gtk/tests/testatk.c_sec3
|
| 1579 |
g_test_add_func("/webkit/atk/caretOffsets", testWebkitAtkCaretOffsets); |
1667 |
g_test_add_func("/webkit/atk/caretOffsets", testWebkitAtkCaretOffsets); |
| 1580 |
g_test_add_func("/webkit/atk/caretOffsetsAndExtranousWhiteSpaces", testWebkitAtkCaretOffsetsAndExtranousWhiteSpaces); |
1668 |
g_test_add_func("/webkit/atk/caretOffsetsAndExtranousWhiteSpaces", testWebkitAtkCaretOffsetsAndExtranousWhiteSpaces); |
| 1581 |
g_test_add_func("/webkit/atk/comboBox", testWebkitAtkComboBox); |
1669 |
g_test_add_func("/webkit/atk/comboBox", testWebkitAtkComboBox); |
|
|
1670 |
g_test_add_func("/webkit/atk/embeddedObjects", testWebkitAtkEmbeddedObjects); |
| 1582 |
g_test_add_func("/webkit/atk/getTextAtOffset", testWebkitAtkGetTextAtOffset); |
1671 |
g_test_add_func("/webkit/atk/getTextAtOffset", testWebkitAtkGetTextAtOffset); |
| 1583 |
g_test_add_func("/webkit/atk/getTextAtOffsetForms", testWebkitAtkGetTextAtOffsetForms); |
1672 |
g_test_add_func("/webkit/atk/getTextAtOffsetForms", testWebkitAtkGetTextAtOffsetForms); |
| 1584 |
g_test_add_func("/webkit/atk/getTextAtOffsetNewlines", testWebkitAtkGetTextAtOffsetNewlines); |
1673 |
g_test_add_func("/webkit/atk/getTextAtOffsetNewlines", testWebkitAtkGetTextAtOffsetNewlines); |
| 1585 |
- |
|
|