Commit eca148ae authored by Sergey Ulanov's avatar Sergey Ulanov Committed by Commit Bot

Add content_shell_fonts in content_shell's data_deps on Fuchsia and Android

After crrev.com/534819 content_shell_fonts are used on Android, but they
were not pulled in data_deps for content shell, so they were not
included when running tests on swarming bots. Now content_shell depends
//third_party//content_shell_fonts, same as it was on Linux.

Also added Android font config files to data_deps on Fuchsia.

Bug: 778467, 787020
Change-Id: I23b65f381ac31012d88b9f66b457cfb7496223d4
Reviewed-on: https://chromium-review.googlesource.com/919875Reviewed-by: default avatarDirk Pranke <dpranke@chromium.org>
Reviewed-by: default avatarPeter Beverloo <peter@chromium.org>
Commit-Queue: Sergey Ulanov <sergeyu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#537417}
parent 0c6506c1
......@@ -590,10 +590,6 @@ if (is_android) {
[ "//third_party/crashpad/crashpad/handler:crashpad_handler" ]
}
if (is_linux) {
data_deps += [ "//third_party/content_shell_fonts" ]
}
if (is_linux && !is_component_build) {
# Set rpath to find our own libfreetype even in a non-component build.
configs += [ "//build/config/gcc:rpath_for_built_shared_libraries" ]
......
......@@ -147,6 +147,7 @@ if (!is_mac) {
}
if (use_x11) {
copy("copy_x11_fonts") {
# TODO(sergeyu): Move these fonts to third_party/content_shell_fonts .
visibility = [ ":*" ]
sources = [
"//third_party/gardiner_mod/GardinerModBug.ttf",
......@@ -158,15 +159,15 @@ if (use_x11) {
]
}
}
if (is_android) {
copy("copy_android_fonts") {
if (is_android || is_fuchsia) {
copy("copy_android_fonts_config") {
visibility = [ ":*" ]
sources = [
"resources/fonts/android_fallback_fonts.xml",
"resources/fonts/android_main_fonts.xml",
]
outputs = [
"$root_out_dir/{{source_file_part}}",
"$root_out_dir/content_shell_test_fonts/{{source_file_part}}",
]
}
}
......@@ -199,8 +200,12 @@ group("resources") {
deps += [ ":copy_x11_fonts" ]
data_deps += [ ":copy_x11_fonts" ]
}
if (is_android) {
deps += [ ":copy_android_fonts" ]
data_deps += [ ":copy_android_fonts" ]
if (is_android || is_fuchsia) {
deps += [ ":copy_android_fonts_config" ]
data_deps += [ ":copy_android_fonts_config" ]
}
if (is_android || is_linux || is_fuchsia) {
deps += [ "//third_party/content_shell_fonts" ]
data_deps += [ "//third_party/content_shell_fonts" ]
}
}
......@@ -390,10 +390,10 @@ class AndroidPort(base.Port):
# TODO(sergeyu): Rename these files, they can be used on platforms
# other than Android.
host_device_tuples.append(
(self._build_path('android_main_fonts.xml'),
(self._build_path('content_shell_test_fonts/android_main_fonts.xml'),
device_path('android_main_fonts.xml')))
host_device_tuples.append(
(self._build_path('android_fallback_fonts.xml'),
(self._build_path('content_shell_test_fonts/android_fallback_fonts.xml'),
device_path('android_fallback_fonts.xml')))
for font_file in self._get_font_files():
host_device_tuples.append(
......
......@@ -68,7 +68,8 @@ _log = logging.getLogger(__name__)
MS_TRUETYPE_FONTS_DIR = '/usr/share/fonts/truetype/msttcorefonts/'
MS_TRUETYPE_FONTS_PACKAGE = 'ttf-mscorefonts-installer'
CONTENT_SHELL_FONTS_DIR = "third_party/content_shell_fonts/content_shell_test_fonts"
# Path relative to the build directory.
CONTENT_SHELL_FONTS_DIR = "content_shell_test_fonts"
FONT_FILES = [
[[MS_TRUETYPE_FONTS_DIR], 'Arial.ttf', MS_TRUETYPE_FONTS_PACKAGE],
......@@ -1869,7 +1870,7 @@ class Port(object):
for font_dir in font_dirs:
font_path = os.path.join(font_dir, font_file)
if not os.path.isabs(font_path):
font_path = self._path_from_chromium_base(font_path)
font_path = self._build_path(font_path)
if self._check_file_exists(font_path, '', more_logging=False):
result.append(font_path)
exists = True
......
......@@ -156,15 +156,11 @@ class _TargetHost(object):
self._target.RunCommand(['mkdir', '/system/fonts'])
self._target.PutFile(
os.path.join(build_path,
'../../content/shell/test_runner/resources/fonts',
'android_main_fonts.xml'),
os.path.join(build_path, 'content_shell_test_fonts', 'android_main_fonts.xml'),
FONTS_DEVICE_PATH + '/fonts.xml')
self._target.PutFile(
os.path.join(build_path,
'../../content/shell/test_runner/resources/fonts',
'android_fallback_fonts.xml'),
os.path.join(build_path, 'content_shell_test_fonts', 'android_fallback_fonts.xml'),
FONTS_DEVICE_PATH + '/fonts_fallback.xml')
self._target.PutFiles(fonts, FONTS_DEVICE_PATH)
......
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