Index: ui/gfx/platform_font_pango_unittest.cc |
diff --git a/ui/gfx/platform_font_pango_unittest.cc b/ui/gfx/platform_font_pango_unittest.cc |
index faa6c1cea425443517763039a518fd8f0f291898..228c66b0201e167a82d66f672c7dfbfa5f5be787 100644 |
--- a/ui/gfx/platform_font_pango_unittest.cc |
+++ b/ui/gfx/platform_font_pango_unittest.cc |
@@ -4,6 +4,12 @@ |
#include "ui/gfx/platform_font_pango.h" |
+#include <cairo/cairo.h> |
+#include <fontconfig/fontconfig.h> |
+#include <glib-object.h> |
+#include <pango/pangocairo.h> |
+#include <pango/pangofc-fontmap.h> |
+ |
#include <string> |
#include "base/memory/ref_counted.h" |
@@ -15,6 +21,9 @@ namespace gfx { |
// Test that PlatformFontPango is able to cope with PangoFontDescriptions |
// containing multiple font families. The first family should be preferred. |
TEST(PlatformFontPangoTest, FamilyList) { |
+ // Needed for GLib versions prior to 2.36. |
+ g_type_init(); |
+ |
ScopedPangoFontDescription desc( |
pango_font_description_from_string("Arial,Times New Roman, 13px")); |
scoped_refptr<gfx::PlatformFontPango> font( |
@@ -28,6 +37,12 @@ TEST(PlatformFontPangoTest, FamilyList) { |
new gfx::PlatformFontPango(desc2.get())); |
EXPECT_EQ("Times New Roman", font2->GetFontName()); |
EXPECT_EQ(15, font2->GetFontSize()); |
+ |
+ // Free memory allocated by FontConfig (http://crbug.com/114750). |
+ pango_fc_font_map_cache_clear( |
+ PANGO_FC_FONT_MAP(pango_cairo_font_map_get_default())); |
+ cairo_debug_reset_static_data(); |
+ FcFini(); |
} |
} // namespace gfx |