OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/gfx/platform_font_pango.h" | 5 #include "ui/gfx/platform_font_pango.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
11 #include "ui/gfx/pango_util.h" | 11 #include "ui/gfx/pango_util.h" |
12 | 12 |
13 namespace gfx { | 13 namespace gfx { |
14 | 14 |
15 // Fails on Chrome OS: http://crbug.com/124451 | 15 // Fails on Chrome OS: http://crbug.com/124451 |
16 #if defined(OS_CHROMEOS) | 16 #if defined(OS_CHROMEOS) |
17 #define MAYBE_FamilyList FAILS_FamilyList | 17 #define MAYBE_FamilyList DISABLED_FamilyList |
18 #else | 18 #else |
19 #define MAYBE_FamilyList FamilyList | 19 #define MAYBE_FamilyList FamilyList |
20 #endif | 20 #endif |
21 | 21 |
22 // Test that PlatformFontPango is able to cope with PangoFontDescriptions | 22 // Test that PlatformFontPango is able to cope with PangoFontDescriptions |
23 // containing multiple font families. The first family should be preferred. | 23 // containing multiple font families. The first family should be preferred. |
24 TEST(PlatformFontPangoTest, MAYBE_FamilyList) { | 24 TEST(PlatformFontPangoTest, MAYBE_FamilyList) { |
25 ScopedPangoFontDescription desc( | 25 ScopedPangoFontDescription desc( |
26 pango_font_description_from_string("Arial,Times New Roman, 13px")); | 26 pango_font_description_from_string("Arial,Times New Roman, 13px")); |
27 scoped_refptr<gfx::PlatformFontPango> font( | 27 scoped_refptr<gfx::PlatformFontPango> font( |
28 new gfx::PlatformFontPango(desc.get())); | 28 new gfx::PlatformFontPango(desc.get())); |
29 EXPECT_EQ("Arial", font->GetFontName()); | 29 EXPECT_EQ("Arial", font->GetFontName()); |
30 EXPECT_EQ(13, font->GetFontSize()); | 30 EXPECT_EQ(13, font->GetFontSize()); |
31 | 31 |
32 ScopedPangoFontDescription desc2( | 32 ScopedPangoFontDescription desc2( |
33 pango_font_description_from_string("Times New Roman,Arial, 15px")); | 33 pango_font_description_from_string("Times New Roman,Arial, 15px")); |
34 scoped_refptr<gfx::PlatformFontPango> font2( | 34 scoped_refptr<gfx::PlatformFontPango> font2( |
35 new gfx::PlatformFontPango(desc2.get())); | 35 new gfx::PlatformFontPango(desc2.get())); |
36 EXPECT_EQ("Times New Roman", font2->GetFontName()); | 36 EXPECT_EQ("Times New Roman", font2->GetFontName()); |
37 EXPECT_EQ(15, font2->GetFontSize()); | 37 EXPECT_EQ(15, font2->GetFontSize()); |
38 } | 38 } |
39 | 39 |
40 } // namespace gfx | 40 } // namespace gfx |
OLD | NEW |