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

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

Issue 11188005: Merge 161704 - Don't hang if can't downsize font. (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1271/src/
Patch Set: Created 8 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « ui/gfx/platform_font_win.cc ('k') | no next file » | 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/platform_font_win.h" 5 #include "ui/gfx/platform_font_win.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 #include "ui/gfx/font.h" 10 #include "ui/gfx/font.h"
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 static_cast<PlatformFontWin*>(base_font.platform_font()); 85 static_cast<PlatformFontWin*>(base_font.platform_font());
86 86
87 const Font derived_font = 87 const Font derived_font =
88 platform_font->DeriveFontWithHeight(min_font.GetHeight() - 1, 0); 88 platform_font->DeriveFontWithHeight(min_font.GetHeight() - 1, 0);
89 EXPECT_EQ(min_font.GetFontSize(), derived_font.GetFontSize()); 89 EXPECT_EQ(min_font.GetFontSize(), derived_font.GetFontSize());
90 EXPECT_EQ(min_font.GetHeight(), derived_font.GetHeight()); 90 EXPECT_EQ(min_font.GetHeight(), derived_font.GetHeight());
91 91
92 PlatformFontWin::get_minimum_font_size_callback = old_callback; 92 PlatformFontWin::get_minimum_font_size_callback = old_callback;
93 } 93 }
94 94
95 TEST(PlatformFontWinTest, DeriveFontWithHeight_TooSmall) {
96 const Font base_font;
97 PlatformFontWin* platform_font =
98 static_cast<PlatformFontWin*>(base_font.platform_font());
99
100 const Font derived_font = platform_font->DeriveFontWithHeight(1, 0);
101 EXPECT_GT(derived_font.GetHeight(), 1);
102 }
103
95 } // namespace gfx 104 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/platform_font_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698