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

Unified Diff: ui/gfx/platform_font_pango_unittest.cc

Issue 10406014: Add a ScopedPangoFontDescription helper class and use it. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 7 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 | « ui/gfx/platform_font_pango.cc ('k') | ui/gfx/render_text_linux.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/platform_font_pango_unittest.cc
===================================================================
--- ui/gfx/platform_font_pango_unittest.cc (revision 137485)
+++ ui/gfx/platform_font_pango_unittest.cc (working copy)
@@ -10,6 +10,8 @@
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/gfx/pango_util.h"
+namespace gfx {
+
// Fails on Chrome OS: http://crbug.com/124451
#if defined(OS_CHROMEOS)
#define MAYBE_FamilyList FAILS_FamilyList
@@ -20,16 +22,19 @@
// Test that PlatformFontPango is able to cope with PangoFontDescriptions
// containing multiple font families. The first family should be preferred.
TEST(PlatformFontPangoTest, MAYBE_FamilyList) {
- PangoFontDescription* desc =
- pango_font_description_from_string("Arial,Times New Roman, 13px");
- scoped_refptr<gfx::PlatformFontPango> font(new gfx::PlatformFontPango(desc));
- pango_font_description_free(desc);
+ ScopedPangoFontDescription desc(
+ pango_font_description_from_string("Arial,Times New Roman, 13px"));
+ scoped_refptr<gfx::PlatformFontPango> font(
+ new gfx::PlatformFontPango(desc.get()));
EXPECT_EQ("Arial", font->GetFontName());
EXPECT_EQ(13, font->GetFontSize());
- desc = pango_font_description_from_string("Times New Roman,Arial, 15px");
- scoped_refptr<gfx::PlatformFontPango> font2(new gfx::PlatformFontPango(desc));
- pango_font_description_free(desc);
+ ScopedPangoFontDescription desc2(
+ pango_font_description_from_string("Times New Roman,Arial, 15px"));
+ scoped_refptr<gfx::PlatformFontPango> font2(
+ new gfx::PlatformFontPango(desc2.get()));
EXPECT_EQ("Times New Roman", font2->GetFontName());
EXPECT_EQ(15, font2->GetFontSize());
}
+
+} // namespace gfx
« no previous file with comments | « ui/gfx/platform_font_pango.cc ('k') | ui/gfx/render_text_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698