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 <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/strings/string_number_conversions.h" | 11 #include "base/strings/string_number_conversions.h" |
12 #include "base/strings/string_util.h" | 12 #include "base/strings/string_util.h" |
| 13 #include "build/build_config.h" |
13 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
14 | 15 |
15 namespace { | 16 namespace { |
16 | 17 |
17 // Helper function for comparing fonts for equality. | 18 // Helper function for comparing fonts for equality. |
18 std::string FontToString(const gfx::Font& font) { | 19 std::string FontToString(const gfx::Font& font) { |
19 std::string font_string = font.GetFontName(); | 20 std::string font_string = font.GetFontName(); |
20 font_string += "|"; | 21 font_string += "|"; |
21 font_string += base::IntToString(font.GetFontSize()); | 22 font_string += base::IntToString(font.GetFontSize()); |
22 int style = font.GetStyle(); | 23 int style = font.GetStyle(); |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 | 310 |
310 // A larger upper bound should not change the height of the font list. | 311 // A larger upper bound should not change the height of the font list. |
311 const int height_2 = font_list.GetHeight() + 5; | 312 const int height_2 = font_list.GetHeight() + 5; |
312 FontList derived_2 = font_list.DeriveWithHeightUpperBound(height_2); | 313 FontList derived_2 = font_list.DeriveWithHeightUpperBound(height_2); |
313 EXPECT_LE(derived_2.GetHeight(), height_2); | 314 EXPECT_LE(derived_2.GetHeight(), height_2); |
314 EXPECT_EQ(font_list.GetHeight(), derived_2.GetHeight()); | 315 EXPECT_EQ(font_list.GetHeight(), derived_2.GetHeight()); |
315 EXPECT_EQ(font_list.GetFontSize(), derived_2.GetFontSize()); | 316 EXPECT_EQ(font_list.GetFontSize(), derived_2.GetFontSize()); |
316 } | 317 } |
317 | 318 |
318 } // namespace gfx | 319 } // namespace gfx |
OLD | NEW |