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_linux.h" | 5 #include "ui/gfx/platform_font_linux.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 public: | 63 public: |
64 PlatformFontLinuxTest() { | 64 PlatformFontLinuxTest() { |
65 SetUpFontconfig(); | 65 SetUpFontconfig(); |
66 original_font_delegate_ = LinuxFontDelegate::instance(); | 66 original_font_delegate_ = LinuxFontDelegate::instance(); |
67 LinuxFontDelegate::SetInstance(&test_font_delegate_); | 67 LinuxFontDelegate::SetInstance(&test_font_delegate_); |
68 } | 68 } |
69 | 69 |
70 ~PlatformFontLinuxTest() override { | 70 ~PlatformFontLinuxTest() override { |
71 LinuxFontDelegate::SetInstance( | 71 LinuxFontDelegate::SetInstance( |
72 const_cast<LinuxFontDelegate*>(original_font_delegate_)); | 72 const_cast<LinuxFontDelegate*>(original_font_delegate_)); |
| 73 PlatformFontLinux::ReloadDefaultFont(); |
73 TearDownFontconfig(); | 74 TearDownFontconfig(); |
74 } | 75 } |
75 | 76 |
76 protected: | 77 protected: |
77 TestFontDelegate test_font_delegate_; | 78 TestFontDelegate test_font_delegate_; |
78 | 79 |
79 private: | 80 private: |
80 // Originally-registered delegate. | 81 // Originally-registered delegate. |
81 const LinuxFontDelegate* original_font_delegate_; | 82 const LinuxFontDelegate* original_font_delegate_; |
82 | 83 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 #endif | 123 #endif |
123 PlatformFontLinux::ReloadDefaultFont(); | 124 PlatformFontLinux::ReloadDefaultFont(); |
124 scoped_refptr<gfx::PlatformFontLinux> font2(new gfx::PlatformFontLinux()); | 125 scoped_refptr<gfx::PlatformFontLinux> font2(new gfx::PlatformFontLinux()); |
125 EXPECT_EQ("Times New Roman", font2->GetFontName()); | 126 EXPECT_EQ("Times New Roman", font2->GetFontName()); |
126 EXPECT_EQ(15, font2->GetFontSize()); | 127 EXPECT_EQ(15, font2->GetFontSize()); |
127 EXPECT_NE(font2->GetStyle() & Font::ITALIC, 0); | 128 EXPECT_NE(font2->GetStyle() & Font::ITALIC, 0); |
128 EXPECT_EQ(gfx::Font::Weight::BOLD, font2->GetWeight()); | 129 EXPECT_EQ(gfx::Font::Weight::BOLD, font2->GetWeight()); |
129 } | 130 } |
130 | 131 |
131 } // namespace gfx | 132 } // namespace gfx |
OLD | NEW |