Skip to content

Commit

Permalink
Merge ui_locale_test_pak with ui_test_pak.
Browse files Browse the repository at this point in the history
ui_locale_test_pak was just doing more things in case the OS was not mac:

1- it outputs a locale.pak on iOS
2- it outputs an en-US.pak for the other platforms besides Mac.
3- in the end it copies ui_resources_100_percent.pak into <(PRODUCT_DIR>/ui

We can 'easily' fold all this into ui_test_pak and that is what we do in this patch, so the clients do not have to worry about. They should not need to decide if they need to depend on ui_locale_test_pak or not. They should depend just on ui_test_pak and everything should be setup for them "automagically".

BUG=355203
TEST=ui_unittests, app_list_unittests, message_center_unittests ...
R=tony@chromium.org,blundell@chromium.org,tapted@chromium.org,oshima@chromium.org
TBR=ben

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@259519 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
tfarina@chromium.org committed Mar 26, 2014
1 parent 9b8f498 commit fab545c
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 75 deletions.
5 changes: 0 additions & 5 deletions ui/app_list/app_list.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -254,11 +254,6 @@
['exclude', 'cocoa/'],
],
}],
['desktop_linux == 1 or chromeos == 1 or OS == "ios"', {
'dependencies': [
'../base/strings/ui_strings.gyp:ui_locale_test_pak',
],
}],
# See http://crbug.com/162998#c4 for why this is needed.
# TODO(dmikurube): Kill linux_use_tcmalloc. http://crbug.com/345554
['OS=="linux" and ((use_allocator!="none" and use_allocator!="see_use_tcmalloc") or (use_allocator=="see_use_tcmalloc" and linux_use_tcmalloc==1))', {
Expand Down
53 changes: 0 additions & 53 deletions ui/base/strings/ui_strings.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -37,57 +37,4 @@
},
},
],
'conditions': [
['OS != "mac"', {
'targets': [{
'target_name': 'ui_locale_test_pak',
'type': 'none',
'dependencies': [
'ui_strings',
],
'variables': {
'repack_path': '<(DEPTH)/tools/grit/grit/format/repack.py',
'conditions': [
['OS == "ios"', {
'pak_output': '<(PRODUCT_DIR)/ui/en.lproj/locale.pak',
}, {
'pak_output': '<(PRODUCT_DIR)/ui/en-US.pak',
}],
],
},
'actions': [
{
'action_name': 'repack_ui_locale_test_pak',
'variables': {
'pak_inputs': [
'<(grit_base_out_dir)/ui_strings/ui_strings_en-US.pak',
'<(grit_base_out_dir)/app_locale_settings/app_locale_settings_en-US.pak',
],
},
'inputs': [
'<(repack_path)',
'<@(pak_inputs)',
],
'outputs': [
'<(pak_output)',
],
'action': [
'python',
'<(repack_path)',
'<@(_outputs)',
'<@(pak_inputs)'
],
},
],
'copies': [
{
'destination': '<(PRODUCT_DIR)/ui',
'files': [
'<(grit_base_out_dir)/ui_resources/ui_resources_100_percent.pak',
],
},
],
}],
}],
],
}
2 changes: 1 addition & 1 deletion ui/base/test/run_all_unittests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ void UIBaseTestSuite::Initialize() {
exe_path.AppendASCII("ui_test.pak"));

// ui_unittests can't depend on the locales folder which Chrome will make
// later, so use the path created by ui_locale_test_pak.
// later, so use the path created by ui_test_pak.
PathService::Override(ui::DIR_LOCALES, exe_path.AppendASCII("ui"));
#endif
}
Expand Down
5 changes: 0 additions & 5 deletions ui/message_center/message_center.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -199,11 +199,6 @@
'test/run_all_unittests.cc',
],
'conditions': [
['desktop_linux == 1 or chromeos == 1 or OS=="ios"', {
'dependencies': [
'../base/strings/ui_strings.gyp:ui_locale_test_pak',
],
}],
['OS=="mac"', {
'dependencies': [
'../gfx/gfx.gyp:gfx_test_support',
Expand Down
59 changes: 58 additions & 1 deletion ui/resources/ui_resources.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,66 @@
'outputs': [
'<(PRODUCT_DIR)/ui_test.pak',
],
'action': ['python', '<(repack_path)', '<@(_outputs)', '<@(pak_inputs)'],
'action': [
'python',
'<(repack_path)',
'<@(_outputs)',
'<@(pak_inputs)'
],
},
],
'conditions': [
['OS != "mac"', {
'copies': [
{
'destination': '<(PRODUCT_DIR)/ui',
'files': [
'<(SHARED_INTERMEDIATE_DIR)/ui/ui_resources/ui_resources_100_percent.pak',
],
},
],
}],
['OS == "ios"', {
'actions': [
{
'action_name': 'copy_ui_test_pak',
'message': 'Copying ui_test.pak into locale.pak',
'inputs': [
'<(PRODUCT_DIR)/ui_test.pak',
],
'outputs': [
'<(PRODUCT_DIR)/ui/en.lproj/locale.pak',
],
'action': [
'python',
'../../build/cp.py',
'<@(_inputs)',
'<@(_outputs)'
],
},
],
}],
['OS != "mac" and OS !="ios"', {
'actions': [
{
'action_name': 'copy_ui_test_pak',
'message': 'Copying ui_test.pak into en-US.pak',
'inputs': [
'<(PRODUCT_DIR)/ui_test.pak',
],
'outputs': [
'<(PRODUCT_DIR)/ui/en-US.pak',
],
'action': [
'python',
'../../build/cp.py',
'<@(_inputs)',
'<@(_outputs)'
],
},
],
}],
],
},
],
}
11 changes: 1 addition & 10 deletions ui/ui_unittests.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@
],
# The ResourceBundle unittest expects a locale.pak file to exist in
# the bundle for English-US. Copy it in from where it was generated
# by ui_strings.gyp:ui_locale_test_pak.
# by ui_resources.gyp:ui_test_pak.
'mac_bundle_resources': [
'<(PRODUCT_DIR)/ui/en.lproj/locale.pak',
],
Expand Down Expand Up @@ -234,11 +234,6 @@
'../testing/android/native_test.gyp:native_test_native_code',
],
}],
['desktop_linux == 1 or chromeos == 1 or OS == "ios"', {
'dependencies': [
'base/strings/ui_strings.gyp:ui_locale_test_pak',
],
}],
['use_pango == 1', {
'dependencies': [
'../build/linux/system.gyp:fontconfig',
Expand Down Expand Up @@ -290,10 +285,6 @@
'gfx/gfx.gyp:gfx_test_support',
'ui_unittests_bundle',
],
}, { # OS!="mac"
'dependencies': [
'base/strings/ui_strings.gyp:ui_locale_test_pak',
],
}],
['use_aura==1 or toolkit_views==1', {
'sources': [
Expand Down

0 comments on commit fab545c

Please sign in to comment.