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

Reland: Add Google Sans to FontUniqueNameLookup browser test

Work around previous failure on SkiaRenderer,Vulkan bot by not running
the tests there.

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, 1129552
Change-Id: I7817499d1cc6e60e9a151641022fd1f2de3c51e9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2475698
Commit-Queue: Dominik Röttsches <drott@chromium.org>
Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#817829}
parent 0e8f7e19
...@@ -20,10 +20,18 @@ ...@@ -20,10 +20,18 @@
#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"
#include "base/feature_list.h"
#include "components/viz/common/features.h"
#include "gpu/config/gpu_finch_features.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 +72,10 @@ const char* kExpectedFontFamilyNames[] = {"AndroidClock", ...@@ -64,7 +72,10 @@ const char* kExpectedFontFamilyNames[] = {"AndroidClock",
"Roboto Condensed", "Roboto Condensed",
"Roboto Condensed", "Roboto Condensed",
"Roboto Condensed", "Roboto Condensed",
"Roboto"}; "Roboto",
kGoogleSans,
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 +215,22 @@ IN_PROC_BROWSER_TEST_F(FontUniqueNameBrowserTest, ContentLocalFontsMatching) { ...@@ -204,6 +215,22 @@ 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;
// https://crbug.com/1129552 work around the SkiaRenderer Vulkan bot not
// having the Google Sans font.
bool on_vulkan_bot =
base::FeatureList::IsEnabled(features::kUseSkiaRenderer) &&
base::FeatureList::IsEnabled(features::kVulkan);
if ((!at_least_marshmallow || on_vulkan_bot) &&
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,9 @@ function getFontsWithTestCharsForOS() { ...@@ -51,6 +51,9 @@ 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"],
["Google Sans Bold", "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