Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1222)

Unified Diff: ui/gfx/render_text_unittest.cc

Issue 12182002: Fix RenderTextTest.PangoAttributes test leaks; remove suppressions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/valgrind/memcheck/suppressions.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/render_text_unittest.cc
diff --git a/ui/gfx/render_text_unittest.cc b/ui/gfx/render_text_unittest.cc
index 3935f7fa58d0ca226773d2430d3a739d89b37f21..56aee9f94b070662f7c27fbde3167839f59bac21 100644
--- a/ui/gfx/render_text_unittest.cc
+++ b/ui/gfx/render_text_unittest.cc
@@ -189,15 +189,18 @@ TEST_F(RenderTextTest, PangoAttributes) {
EXPECT_EQ(cases[i].end, end);
PangoFontDescription* font = pango_font_description_new();
pango_attr_iterator_get_font(iter, font, NULL, NULL);
- const string16 desc = ASCIIToUTF16(pango_font_description_to_string(font));
+ char* description_string = pango_font_description_to_string(font);
+ const string16 desc = ASCIIToUTF16(description_string);
const bool bold = desc.find(ASCIIToUTF16("Bold")) != std::string::npos;
EXPECT_EQ(cases[i].bold, bold);
const bool italic = desc.find(ASCIIToUTF16("Italic")) != std::string::npos;
EXPECT_EQ(cases[i].italic, italic);
pango_attr_iterator_next(iter);
pango_font_description_free(font);
+ g_free(description_string);
}
EXPECT_FALSE(pango_attr_iterator_next(iter));
+ pango_attr_iterator_destroy(iter);
}
#endif
« no previous file with comments | « tools/valgrind/memcheck/suppressions.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698