Commit bac8fafd authored by tapted's avatar tapted Committed by Commit bot

Simplify test locales in Mac's ui_unittests Framework

Mac creates a mini-framework in `ui_unittests Framework` so that ui
tests can get a resource bundle without depending on the Chrome
framework.

The way it generated locale information was causing build flakes since
two instances of repack_locales.py could be writing to
out/../gen/repack. Tests always use en-US, so instead just do what iOS
does and copy ui_test.pak to en.lproj/locale.pak and roll it into the
mini-framework bundle.

BUG=410468

Review URL: https://codereview.chromium.org/552963002

Cr-Commit-Position: refs/heads/master@{#294052}
parent 261bcb40
......@@ -7,8 +7,6 @@
{
'product_name': 'ui_unittests Framework',
'variables': {
'grit_out_dir': '<(SHARED_INTERMEDIATE_DIR)/ui',
# There is no executable in the mock framework, and so nothing to strip.
'mac_strip': 0,
},
......@@ -25,7 +23,10 @@
'mac_bundle_resources': [
'test/framework-Info.plist',
'<(PRODUCT_DIR)/ui_test.pak',
'<!@pymod_do_main(repack_locales -o -p <(OS) -g <(grit_out_dir) -s <(SHARED_INTERMEDIATE_DIR) -x <(SHARED_INTERMEDIATE_DIR) <(locales))',
# Just include the English-US locale made by ui_resources.gyp:ui_test_pak.
# Note that the file is just a copy of ui_test.pak, with a different path.
'<(PRODUCT_DIR)/ui/en.lproj/locale.pak',
],
'mac_bundle_resources!': [
'test/framework-Info.plist',
......
......@@ -52,12 +52,12 @@ if (!is_mac) {
}
}
# On iOS the output needs to additionally be copied to another location, so
# we have this intermediate step.
# On iOS and Mac the output needs to additionally be copied to another location,
# so we have this intermediate step.
#
# GYP version: ui/resources/ui_resources.gyp:ui_test_pak
# (copy_ui_test_pak action)
if (is_ios) {
if (is_ios || is_mac) {
copy("ui_test_pak") {
sources = [ "$root_out_dir/ui_test.pak" ]
outputs = [ "$root_out_dir/ui/en.lproj/locale.pak" ]
......@@ -74,7 +74,7 @@ repack("repack_ui_test_pak") {
# Depend on ui_test_pak instead of this one.
visibility = [ ":ui_test_pak" ]
sources = [
sources = [
"$root_gen_dir/ui/resources/ui_resources_100_percent.pak",
"$root_gen_dir/ui/resources/webui_resources.pak",
"$root_gen_dir/ui/strings/app_locale_settings_en-US.pak",
......
......@@ -74,7 +74,7 @@
},
],
}],
['OS == "ios"', {
['OS == "ios" or OS == "mac"', {
'actions': [
{
# GN version: //ui/resources:copy_ui_test_pak
......
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