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/font_list.h" | 5 #include "ui/gfx/font_list.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
11 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
12 | 12 |
13 namespace { | 13 namespace { |
14 | 14 |
15 // Helper function for comparing fonts for equality. | 15 // Helper function for comparing fonts for equality. |
16 std::string FontToString(const gfx::Font& font) { | 16 std::string FontToString(const gfx::Font& font) { |
17 std::string font_string = font.GetFontName(); | 17 std::string font_string = font.GetFontName(); |
18 font_string += "|"; | 18 font_string += "|"; |
19 font_string += base::IntToString(font.GetFontSize()); | 19 font_string += base::IntToString(font.GetFontSize()); |
20 int style = font.GetStyle(); | 20 int style = font.GetStyle(); |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 | 226 |
227 FontList derived = font_list.DeriveFontListWithSize(5); | 227 FontList derived = font_list.DeriveFontListWithSize(5); |
228 const std::vector<Font>& derived_fonts = derived.GetFonts(); | 228 const std::vector<Font>& derived_fonts = derived.GetFonts(); |
229 | 229 |
230 EXPECT_EQ(2U, derived_fonts.size()); | 230 EXPECT_EQ(2U, derived_fonts.size()); |
231 EXPECT_EQ("Arial|5", FontToString(derived_fonts[0])); | 231 EXPECT_EQ("Arial|5", FontToString(derived_fonts[0])); |
232 EXPECT_EQ("Sans serif|5", FontToString(derived_fonts[1])); | 232 EXPECT_EQ("Sans serif|5", FontToString(derived_fonts[1])); |
233 } | 233 } |
234 | 234 |
235 } // namespace gfx | 235 } // namespace gfx |
OLD | NEW |