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

Unified Diff: ui/gfx/platform_font_win_unittest.cc

Issue 1513043002: clang/win: Let remaining chromium_code targets build with -Wextra. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/gfx/icon_util_unittest.cc ('k') | ui/gfx/range/range_win_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/platform_font_win_unittest.cc
diff --git a/ui/gfx/platform_font_win_unittest.cc b/ui/gfx/platform_font_win_unittest.cc
index 4c4c50d00d3cdc86bbcb640e8def3837ff38c213..10050f63a0da18e6569c7fe304c5f4e9bd81e6ea 100644
--- a/ui/gfx/platform_font_win_unittest.cc
+++ b/ui/gfx/platform_font_win_unittest.cc
@@ -127,25 +127,24 @@ TEST(PlatformFontWinTest, Metrics_SkiaVersusGDI) {
base::win::ScopedGetDC screen_dc(NULL);
gfx::ScopedSetMapMode mode(screen_dc, MM_TEXT);
- for (int i = 0; i < arraysize(fonts); ++i) {
+ for (const FontInfo& font : fonts) {
LOGFONT font_info = {0};
- font_info.lfHeight = -fonts[i].font_size;
+ font_info.lfHeight = -font.font_size;
font_info.lfWeight = FW_NORMAL;
- wcscpy_s(font_info.lfFaceName,
- fonts[i].font_name.length() + 1,
- fonts[i].font_name.c_str());
+ wcscpy_s(font_info.lfFaceName, font.font_name.length() + 1,
+ font.font_name.c_str());
- HFONT font = CreateFontIndirect(&font_info);
+ HFONT hFont = CreateFontIndirect(&font_info);
TEXTMETRIC font_metrics;
- PlatformFontWin::GetTextMetricsForFont(screen_dc, font, &font_metrics);
+ PlatformFontWin::GetTextMetricsForFont(screen_dc, hFont, &font_metrics);
scoped_refptr<PlatformFontWin::HFontRef> h_font_gdi(
- PlatformFontWin::CreateHFontRefFromGDI(font, font_metrics));
+ PlatformFontWin::CreateHFontRefFromGDI(hFont, font_metrics));
scoped_refptr<PlatformFontWin::HFontRef> h_font_skia(
- PlatformFontWin::CreateHFontRefFromSkia(font, font_metrics));
+ PlatformFontWin::CreateHFontRefFromSkia(hFont, font_metrics));
EXPECT_EQ(h_font_gdi->font_size(), h_font_skia->font_size());
EXPECT_EQ(h_font_gdi->style(), h_font_skia->style());
@@ -185,24 +184,23 @@ TEST(PlatformFontWinTest, DirectWriteFontSubstitution) {
base::win::ScopedGetDC screen_dc(NULL);
gfx::ScopedSetMapMode mode(screen_dc, MM_TEXT);
- for (int i = 0; i < arraysize(fonts); ++i) {
+ for (const FontInfo& font : fonts) {
LOGFONT font_info = {0};
font_info.lfHeight = -10;
font_info.lfWeight = FW_NORMAL;
- wcscpy_s(font_info.lfFaceName,
- fonts[i].font_name.length() + 1,
- fonts[i].font_name.c_str());
+ wcscpy_s(font_info.lfFaceName, font.font_name.length() + 1,
+ font.font_name.c_str());
- HFONT font = CreateFontIndirect(&font_info);
+ HFONT hFont = CreateFontIndirect(&font_info);
TEXTMETRIC font_metrics;
- PlatformFontWin::GetTextMetricsForFont(screen_dc, font, &font_metrics);
+ PlatformFontWin::GetTextMetricsForFont(screen_dc, hFont, &font_metrics);
scoped_refptr<PlatformFontWin::HFontRef> h_font_skia(
- PlatformFontWin::CreateHFontRefFromSkia(font, font_metrics));
+ PlatformFontWin::CreateHFontRefFromSkia(hFont, font_metrics));
- EXPECT_EQ(fonts[i].expected_font_name, h_font_skia->font_name());
+ EXPECT_EQ(font.expected_font_name, h_font_skia->font_name());
}
}
« no previous file with comments | « ui/gfx/icon_util_unittest.cc ('k') | ui/gfx/range/range_win_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698