Commit ee15e47d authored by Dominik Röttsches's avatar Dominik Röttsches Committed by Commit Bot

Add Google Sans to FontUniqueNameLookup browser test

This will help ensure we have local access to the Google Sans although
the bots only verify this on Pixel devices, not on OEM devices which
retrieve Google Sans from GMScore. Currently there is only manual
verification for the latter.

Bug: 1115064
Change-Id: Ie3a2233e1dc972a10aaa4229a6d06ac2220607ec
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2404852Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
Commit-Queue: Dominik Röttsches <drott@chromium.org>
Cr-Commit-Position: refs/heads/master@{#807921}
parent c362db0a
...@@ -20,10 +20,15 @@ ...@@ -20,10 +20,15 @@
#include "content/browser/renderer_host/dwrite_font_lookup_table_builder_win.h" #include "content/browser/renderer_host/dwrite_font_lookup_table_builder_win.h"
#endif #endif
#if defined(OS_ANDROID)
#include "base/android/build_info.h"
#endif
namespace content { namespace content {
namespace { namespace {
#if defined(OS_ANDROID) #if defined(OS_ANDROID)
const char* kGoogleSans = "Google Sans";
const char* kExpectedFontFamilyNames[] = {"AndroidClock", const char* kExpectedFontFamilyNames[] = {"AndroidClock",
"Roboto", "Roboto",
"Droid Sans Mono", "Droid Sans Mono",
...@@ -64,7 +69,9 @@ const char* kExpectedFontFamilyNames[] = {"AndroidClock", ...@@ -64,7 +69,9 @@ const char* kExpectedFontFamilyNames[] = {"AndroidClock",
"Roboto Condensed", "Roboto Condensed",
"Roboto Condensed", "Roboto Condensed",
"Roboto Condensed", "Roboto Condensed",
"Roboto"}; "Roboto",
kGoogleSans,
kGoogleSans};
#elif defined(OS_LINUX) || defined(OS_CHROMEOS) #elif defined(OS_LINUX) || defined(OS_CHROMEOS)
const char* kExpectedFontFamilyNames[] = {"Ahem", const char* kExpectedFontFamilyNames[] = {"Ahem",
"Arimo", "Arimo",
...@@ -204,6 +211,17 @@ IN_PROC_BROWSER_TEST_F(FontUniqueNameBrowserTest, ContentLocalFontsMatching) { ...@@ -204,6 +211,17 @@ IN_PROC_BROWSER_TEST_F(FontUniqueNameBrowserTest, ContentLocalFontsMatching) {
ASSERT_TRUE(first_font_name); ASSERT_TRUE(first_font_name);
ASSERT_TRUE(first_font_name->is_string()); ASSERT_TRUE(first_font_name->is_string());
ASSERT_GT(first_font_name->GetString().size(), 0u); ASSERT_GT(first_font_name->GetString().size(), 0u);
#if defined(OS_ANDROID)
// Skip Android Google Sans test on Pixel devices < Marshmallow SDK level,
// as the firmware font files do not contain this font.
bool at_least_marshmallow =
base::android::BuildInfo::GetInstance()->sdk_int() >=
base::android::SDK_VERSION_MARSHMALLOW;
if (!at_least_marshmallow &&
std::string(kExpectedFontFamilyNames[i]) == std::string(kGoogleSans)) {
continue;
}
#endif
ASSERT_EQ(first_font_name->GetString(), kExpectedFontFamilyNames[i]); ASSERT_EQ(first_font_name->GetString(), kExpectedFontFamilyNames[i]);
} }
} }
......
...@@ -51,6 +51,8 @@ function getFontsWithTestCharsForOS() { ...@@ -51,6 +51,8 @@ function getFontsWithTestCharsForOS() {
["RobotoCondensed-Italic", "0"], ["RobotoCondensed-Italic", "0"],
["RobotoCondensed-Regular", "0"], ["RobotoCondensed-Regular", "0"],
["Roboto-Italic", "0"], ["Roboto-Italic", "0"],
["Google Sans", "0"],
["Google Sans Medium", "0"],
]; ];
} else if (navigator.userAgent.indexOf("Linux") !== -1 } else if (navigator.userAgent.indexOf("Linux") !== -1
|| navigator.userAgent.indexOf("CrOS") !== -1) { || navigator.userAgent.indexOf("CrOS") !== -1) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment