Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Side by Side Diff: ui/gfx/font_list_unittest.cc

Issue 1543183002: Switch to standard integer types in ui/gfx/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/gfx/font_list_impl.cc ('k') | ui/gfx/font_render_params_linux.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « ui/gfx/font_list_impl.cc ('k') | ui/gfx/font_render_params_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698