Encode method and error message inside LevelDB::Status message
[chromium-blink-merge.git] / ui / gfx / platform_font_pango_unittest.cc
blobfaa6c1cea425443517763039a518fd8f0f291898
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "ui/gfx/platform_font_pango.h"
7 #include <string>
9 #include "base/memory/ref_counted.h"
10 #include "testing/gtest/include/gtest/gtest.h"
11 #include "ui/gfx/pango_util.h"
13 namespace gfx {
15 // Test that PlatformFontPango is able to cope with PangoFontDescriptions
16 // containing multiple font families. The first family should be preferred.
17 TEST(PlatformFontPangoTest, FamilyList) {
18 ScopedPangoFontDescription desc(
19 pango_font_description_from_string("Arial,Times New Roman, 13px"));
20 scoped_refptr<gfx::PlatformFontPango> font(
21 new gfx::PlatformFontPango(desc.get()));
22 EXPECT_EQ("Arial", font->GetFontName());
23 EXPECT_EQ(13, font->GetFontSize());
25 ScopedPangoFontDescription desc2(
26 pango_font_description_from_string("Times New Roman,Arial, 15px"));
27 scoped_refptr<gfx::PlatformFontPango> font2(
28 new gfx::PlatformFontPango(desc2.get()));
29 EXPECT_EQ("Times New Roman", font2->GetFontName());
30 EXPECT_EQ(15, font2->GetFontSize());
33 } // namespace gfx