Changeset 154953 in webkit
- Timestamp:
- Sep 2, 2013 7:40:54 AM (11 years ago)
- Location:
- trunk/Source/WebKit/gtk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/gtk/ChangeLog
r154830 r154953 1 2013-09-02 Brian Holt <brian.holt@samsung.com> 2 3 [ATK] Leak: Leaks in testatk.c 4 https://bugs.webkit.org/show_bug.cgi?id=118675 5 6 Reviewed by Mario Sanchez Prada. 7 8 Fixed memory leaks by matching ref calls with unrefs. 9 10 * tests/testatk.c: 11 (testWebkitAtkCaretOffsets): 12 (testWebkitAtkCaretOffsetsAndExtranousWhiteSpaces): 13 (testWebkitAtkGetTextAtOffset): 14 (testWebkitAtkGetTextAtOffsetNewlines): 15 (testWebkitAtkGetTextAtOffsetTextarea): 16 (testWebkitAtkGetTextAtOffsetTextInput): 17 (testWebkitAtkGetTextInParagraphAndBodySimple): 18 (testWebkitAtkGetTextInParagraphAndBodyModerate): 19 (testWebkitAtkTextAttributes): 20 (testWebkitAtkTextSelections): 21 (testWebkitAtkListsOfItems): 22 1 23 2013-08-29 Zan Dobersek <zdobersek@igalia.com> 2 24 -
trunk/Source/WebKit/gtk/tests/testatk.c
r153947 r154953 375 375 g_assert_cmpstr(text, ==, "1. A list item"); 376 376 g_free (text); 377 g_object_unref(listItem); 377 378 378 379 listItem = atk_object_ref_accessible_child(list, 1); … … 381 382 g_assert_cmpstr(text, ==, "2. Block span in a list item\nInline span in a list item"); 382 383 g_free (text); 384 g_object_unref(listItem); 383 385 384 386 listItem = atk_object_ref_accessible_child(list, 2); … … 454 456 offset = atk_text_get_caret_offset(ATK_TEXT(tableCell)); 455 457 g_assert_cmpint(offset, ==, 2); 458 g_object_unref(tableCell); 456 459 457 460 /* Even empty table cells should implement AtkText, but report an empty string */ … … 462 465 g_assert_cmpstr(text, ==, ""); 463 466 g_free(text); 467 g_object_unref(tableCell); 464 468 465 469 tableCell = atk_object_ref_accessible_child(table, 2); … … 469 473 g_assert_cmpstr(text, ==, "Block span in a link in a table cell\nInline span in a link in a table cell"); 470 474 g_free(text); 475 g_object_unref(tableCell); 471 476 472 477 tableCell = atk_object_ref_accessible_child(table, 3); … … 483 488 g_assert_cmpstr(text, ==, "Block span in a link in a heading\nInline span in a link in a heading"); 484 489 g_free(text); 490 g_object_unref(header); 485 491 486 492 header = atk_object_ref_accessible_child(object, 6); … … 549 555 g_assert_cmpint(caretOffset, ==, characterCount); 550 556 557 g_object_unref(object); 551 558 g_object_unref(webView); 552 559 } … … 806 813 runGetTextTests(textObject); 807 814 815 g_object_unref(object); 808 816 g_object_unref(webView); 809 817 } … … 828 836 runGetTextTests(textObject); 829 837 838 g_object_unref(object); 830 839 g_object_unref(webView); 831 840 } … … 842 851 AtkObject* object = getWebAreaObject(webView); 843 852 g_assert(object); 844 object= atk_object_ref_accessible_child(object, 0);845 g_assert( object);846 object = atk_object_ref_accessible_child(object, 0);847 g_assert( object);848 849 AtkText* textObject = ATK_TEXT( object);853 AtkObject* child = atk_object_ref_accessible_child(object, 0); 854 g_assert(child); 855 AtkObject* grandchild = atk_object_ref_accessible_child(child, 0); 856 g_assert(grandchild); 857 858 AtkText* textObject = ATK_TEXT(grandchild); 850 859 g_assert(ATK_IS_TEXT(textObject)); 851 860 852 861 runGetTextTests(textObject); 853 862 863 g_object_unref(child); 864 g_object_unref(grandchild); 854 865 g_object_unref(webView); 855 866 } … … 866 877 AtkObject* object = getWebAreaObject(webView); 867 878 g_assert(object); 868 object= atk_object_ref_accessible_child(object, 0);869 g_assert( object);870 object = atk_object_ref_accessible_child(object, 0);871 g_assert( object);872 873 AtkText* textObject = ATK_TEXT( object);879 AtkObject* child = atk_object_ref_accessible_child(object, 0); 880 g_assert(child); 881 AtkObject* grandchild = atk_object_ref_accessible_child(child, 0); 882 g_assert(grandchild); 883 884 AtkText* textObject = ATK_TEXT(grandchild); 874 885 g_assert(ATK_IS_TEXT(textObject)); 875 886 876 887 runGetTextTests(textObject); 877 888 889 g_object_unref(child); 890 g_object_unref(grandchild); 878 891 g_object_unref(webView); 879 892 } … … 1150 1163 char *text = atk_text_get_text(textObject1, 0, -1); 1151 1164 g_assert_cmpstr(text, ==, "This is a test."); 1165 g_free(text); 1152 1166 1153 1167 text = atk_text_get_text(textObject2, 0, 12); 1154 1168 g_assert_cmpstr(text, ==, "Hello world."); 1169 g_free(text); 1155 1170 1156 1171 g_object_unref(object1); … … 1182 1197 char *text = atk_text_get_text(textObject1, 0, -1); 1183 1198 g_assert_cmpstr(text, ==, "This is a test."); 1199 g_free(text); 1184 1200 1185 1201 text = atk_text_get_text(textObject2, 0, 53); 1186 1202 g_assert_cmpstr(text, ==, "Hello world.\nThis sentence is green.\nThis one is not."); 1203 g_free(text); 1187 1204 1188 1205 g_object_unref(object1); … … 1383 1400 atk_attribute_set_free(set4); 1384 1401 1402 g_object_unref(child); 1385 1403 child = atk_object_ref_accessible_child(object, 1); 1386 1404 g_assert(child && ATK_IS_TEXT(child)); … … 1403 1421 atk_attribute_set_free(set1); 1404 1422 atk_attribute_set_free(set2); 1423 g_object_unref(child); 1405 1424 1406 1425 child = atk_object_ref_accessible_child(object, 2); … … 1428 1447 atk_attribute_set_free(set3); 1429 1448 atk_attribute_set_free(set4); 1449 g_object_unref(child); 1430 1450 1431 1451 child = atk_object_ref_accessible_child(object, 3); … … 1447 1467 atk_attribute_set_free(set2); 1448 1468 atk_attribute_set_free(set3); 1469 1470 g_object_unref(child); 1449 1471 } 1450 1472 … … 1619 1641 g_object_unref(paragraph1); 1620 1642 g_object_unref(paragraph2); 1643 g_object_unref(link); 1621 1644 g_object_unref(list); 1622 1645 g_object_unref(listItem); … … 1942 1965 g_assert_cmpint(atk_object_get_n_accessible_children(item3), ==, 1); 1943 1966 1944 g_assert_cmpstr(atk_text_get_text(ATK_TEXT(item1), 0, -1), ==, "\342\200\242 text only"); 1945 g_assert_cmpstr(atk_text_get_text(ATK_TEXT(item2), 0, -1), ==, "\342\200\242 link only"); 1946 g_assert_cmpstr(atk_text_get_text(ATK_TEXT(item3), 0, -1), ==, "\342\200\242 text and a link"); 1967 char* text = atk_text_get_text(ATK_TEXT(item1), 0, -1); 1968 g_assert_cmpstr(text, ==, "\342\200\242 text only"); 1969 g_free(text); 1970 text = atk_text_get_text(ATK_TEXT(item2), 0, -1); 1971 g_assert_cmpstr(text, ==, "\342\200\242 link only"); 1972 g_free(text); 1973 text = atk_text_get_text(ATK_TEXT(item3), 0, -1); 1974 g_assert_cmpstr(text, ==, "\342\200\242 text and a link"); 1975 g_free(text); 1947 1976 1948 1977 g_object_unref(item1); … … 1964 1993 g_assert(ATK_IS_TEXT(item3)); 1965 1994 1966 g_assert_cmpstr(atk_text_get_text(ATK_TEXT(item1), 0, -1), ==, "1. text only"); 1967 g_assert_cmpstr(atk_text_get_text(ATK_TEXT(item2), 0, -1), ==, "2. link only"); 1968 g_assert_cmpstr(atk_text_get_text(ATK_TEXT(item3), 0, -1), ==, "3. text and a link"); 1995 text = atk_text_get_text(ATK_TEXT(item1), 0, -1); 1996 g_assert_cmpstr(text, ==, "1. text only"); 1997 g_free(text); 1998 text = atk_text_get_text(ATK_TEXT(item2), 0, -1); 1999 g_assert_cmpstr(text, ==, "2. link only"); 2000 g_free(text); 2001 text = atk_text_get_text(ATK_TEXT(item3), 0, -1); 2002 g_assert_cmpstr(text, ==, "3. text and a link"); 2003 g_free(text); 1969 2004 1970 2005 g_assert_cmpint(atk_object_get_n_accessible_children(item1), ==, 0);
Note: See TracChangeset
for help on using the changeset viewer.