From 85eb3e19a686b43dd9afe2e307ab36d5c410ff1e Mon Sep 17 00:00:00 2001 From: "yukishiino@chromium.org" Date: Thu, 27 Feb 2014 20:44:12 +0000 Subject: Makes it clear in unittests that the system is missing some of fonts. Added some error messages to FontTest.GetActualFontNameForTesting. BUG=347429 TEST=Run ui_unittests. Review URL: https://codereview.chromium.org/182873002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@253920 0039d316-1c4b-4281-b951-d872f2087c98 --- ui/gfx/font_unittest.cc | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'ui') diff --git a/ui/gfx/font_unittest.cc b/ui/gfx/font_unittest.cc index 9188735..da4bdfc 100644 --- a/ui/gfx/font_unittest.cc +++ b/ui/gfx/font_unittest.cc @@ -109,11 +109,23 @@ TEST_F(FontTest, AvgWidths) { #if !defined(OS_WIN) // On Windows, Font::GetActualFontNameForTesting() doesn't work well for now. // http://crbug.com/327287 +// +// Check that fonts used for testing are installed and enabled. On Mac +// fonts may be installed but still need enabling in Font Book.app. +// http://crbug.com/347429 TEST_F(FontTest, GetActualFontNameForTesting) { Font arial("Arial", 16); - EXPECT_EQ("arial", StringToLowerASCII(arial.GetActualFontNameForTesting())); + EXPECT_EQ("arial", StringToLowerASCII(arial.GetActualFontNameForTesting())) + << "********\n" + << "Your test environment seems to be missing Arial font, which is " + << "needed for unittests. Check if Arial font is installed.\n" + << "********"; Font symbol("Symbol", 16); - EXPECT_EQ("symbol", StringToLowerASCII(symbol.GetActualFontNameForTesting())); + EXPECT_EQ("symbol", StringToLowerASCII(symbol.GetActualFontNameForTesting())) + << "********\n" + << "Your test environment seems to be missing Symbol font, which is " + << "needed for unittests. Check if Symbol font is installed.\n" + << "********"; const char* const invalid_font_name = "no_such_font_name"; Font fallback_font(invalid_font_name, 16); -- cgit v1.1