diff options
author | peter@chromium.org <peter@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-20 20:18:25 +0000 |
---|---|---|
committer | peter@chromium.org <peter@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-20 20:18:25 +0000 |
commit | e4d46c35a05efde6e46b98022d13b4b5384323cb (patch) | |
tree | dbb12778cc8916a07a00f62fc689274b336733aa /content/shell | |
parent | 5fce8d3b98a9264bd4bb917996f90ed06c5ea23b (diff) | |
download | chromium_src-e4d46c35a05efde6e46b98022d13b4b5384323cb.zip chromium_src-e4d46c35a05efde6e46b98022d13b4b5384323cb.tar.gz chromium_src-e4d46c35a05efde6e46b98022d13b4b5384323cb.tar.bz2 |
content_shell: Load the correct fonts and reset hinting for Android layout tests
This fixes most of the text differences in layout tests, because Android's
default serif font is much wider than the one used on Linux. Load the
right font configuration files through Skia and set up WebKit to use
normal font hinting.
BUG=232044
R=jochen@chromium.org
Review URL: https://codereview.chromium.org/17405002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@207536 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/shell')
-rw-r--r-- | content/shell/webkit_test_platform_support_android.cc | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/content/shell/webkit_test_platform_support_android.cc b/content/shell/webkit_test_platform_support_android.cc index a91690c..cd8f076 100644 --- a/content/shell/webkit_test_platform_support_android.cc +++ b/content/shell/webkit_test_platform_support_android.cc @@ -4,6 +4,27 @@ #include "content/shell/webkit_test_platform_support.h" +#include "third_party/skia/include/ports/SkTypeface_android.h" + +namespace { + +// The root directory on the device to which resources will be pushed. This +// value needs to be equal to that set in chromium_android.py. +#define DEVICE_SOURCE_ROOT_DIR "/data/local/tmp/content_shell/" + +// Primary font configuration file on the device for Skia. +const char kPrimaryFontConfig[] = + DEVICE_SOURCE_ROOT_DIR "android_main_fonts.xml"; + +// The file on the device containing the fallback font configuration for Skia. +const char kFallbackFontConfig[] = + DEVICE_SOURCE_ROOT_DIR "android_fallback_fonts.xml"; + +// The directory in which fonts will be stored on the Android device. +const char kFontDirectory[] = DEVICE_SOURCE_ROOT_DIR "fonts/"; + +} // namespace + namespace content { bool CheckLayoutSystemDeps() { @@ -11,7 +32,11 @@ bool CheckLayoutSystemDeps() { } bool WebKitTestPlatformInitialize() { + // Initialize Skia with the font configuration files crafted for layout tests. + SkUseTestFontConfigFile( + kPrimaryFontConfig, kFallbackFontConfig, kFontDirectory); + return true; } -} // namespace +} // namespace content |