Commit b49ced66 authored by tfarina@chromium.org's avatar tfarina@chromium.org

extensions: Create extensions_pak target.

Currently this was just an action directly into extensions_unittests.

But we want to share the same pak file between extensions_unittests and app_shell.

So in order to do this we create a new target called "extensions_pak" and make
 extensions_unittests depend on it.

After this lands, app_shell will be refactored to use extensions.pak too.

BUG=397250
TEST=extensions_unittests
R=jamescook@chromium.org
TBR=yoz@chromium.org

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@285597 0039d316-1c4b-4281-b951-d872f2087c98
parent c312bd56
...@@ -690,6 +690,33 @@ ...@@ -690,6 +690,33 @@
# Disable c4267 warnings until we fix size_t to int truncations. # Disable c4267 warnings until we fix size_t to int truncations.
'msvs_disabled_warnings': [ 4267, ], 'msvs_disabled_warnings': [ 4267, ],
}, },
{
# TODO(jamescook): Use the same .pak file for both app_shell and
# extensions_unittests by creating an extensions_resources.pak file
# that can be used in both places. This will save build time.
# http://crbug.com/397250
'target_name': 'extensions_pak',
'type': 'none',
'dependencies': [
'../ui/strings/ui_strings.gyp:ui_strings',
'extensions_resources.gyp:extensions_resources',
],
'actions': [
{
'action_name': 'repack_extensions_pak',
'variables': {
'pak_inputs': [
'<(SHARED_INTERMEDIATE_DIR)/extensions/extensions_resources.pak',
'<(SHARED_INTERMEDIATE_DIR)/extensions/extensions_renderer_resources.pak',
'<(SHARED_INTERMEDIATE_DIR)/ui/strings/app_locale_settings_en-US.pak',
'<(SHARED_INTERMEDIATE_DIR)/ui/strings/ui_strings_en-US.pak',
],
'pak_output': '<(PRODUCT_DIR)/extensions.pak',
},
'includes': [ '../build/repack_action.gypi' ],
},
],
},
{ {
# TODO(tfarina): Many extension unit tests run as part of Chrome's # TODO(tfarina): Many extension unit tests run as part of Chrome's
# unit_tests target. They should be moved here, which may require some # unit_tests target. They should be moved here, which may require some
...@@ -703,8 +730,8 @@ ...@@ -703,8 +730,8 @@
'../content/content_shell_and_tests.gyp:test_support_content', '../content/content_shell_and_tests.gyp:test_support_content',
'../testing/gmock.gyp:gmock', '../testing/gmock.gyp:gmock',
'../testing/gtest.gyp:gtest', '../testing/gtest.gyp:gtest',
'../ui/strings/ui_strings.gyp:ui_strings',
'extensions_common', 'extensions_common',
'extensions_pak',
'extensions_renderer', 'extensions_renderer',
'extensions_resources.gyp:extensions_resources', 'extensions_resources.gyp:extensions_resources',
'extensions_strings.gyp:extensions_strings', 'extensions_strings.gyp:extensions_strings',
...@@ -742,25 +769,6 @@ ...@@ -742,25 +769,6 @@
], ],
}], }],
], ],
'actions': [
{
# TODO(jamescook): Use the same .pak file for both app_shell and
# extensions_unittests by creating an extensions_resources.pak file
# that can be used in both places. This will save build time.
# http://crbug.com/397250
'action_name': 'repack_extensions_unittests_pak',
'variables': {
'pak_inputs': [
'<(SHARED_INTERMEDIATE_DIR)/extensions/extensions_resources.pak',
'<(SHARED_INTERMEDIATE_DIR)/extensions/extensions_renderer_resources.pak',
'<(SHARED_INTERMEDIATE_DIR)/ui/strings/app_locale_settings_en-US.pak',
'<(SHARED_INTERMEDIATE_DIR)/ui/strings/ui_strings_en-US.pak',
],
'pak_output': '<(PRODUCT_DIR)/extensions_unittests_resources.pak',
},
'includes': [ '../build/repack_action.gypi' ],
},
],
}, },
] ]
} }
...@@ -74,10 +74,10 @@ void ExtensionsTestSuite::Initialize() { ...@@ -74,10 +74,10 @@ void ExtensionsTestSuite::Initialize() {
extensions::RegisterPathProvider(); extensions::RegisterPathProvider();
base::FilePath resources_pack_path; base::FilePath extensions_pak_path;
PathService::Get(base::DIR_MODULE, &resources_pack_path); PathService::Get(base::DIR_MODULE, &extensions_pak_path);
ResourceBundle::InitSharedInstanceWithPakPath( ui::ResourceBundle::InitSharedInstanceWithPakPath(
resources_pack_path.AppendASCII("extensions_unittests_resources.pak")); extensions_pak_path.AppendASCII("extensions.pak"));
client_.reset(new extensions::TestExtensionsClient()); client_.reset(new extensions::TestExtensionsClient());
extensions::ExtensionsClient::Set(client_.get()); extensions::ExtensionsClient::Set(client_.get());
...@@ -87,7 +87,7 @@ void ExtensionsTestSuite::Shutdown() { ...@@ -87,7 +87,7 @@ void ExtensionsTestSuite::Shutdown() {
extensions::ExtensionsClient::Set(NULL); extensions::ExtensionsClient::Set(NULL);
client_.reset(); client_.reset();
ResourceBundle::CleanupSharedInstance(); ui::ResourceBundle::CleanupSharedInstance();
content::ContentTestSuiteBase::Shutdown(); content::ContentTestSuiteBase::Shutdown();
} }
......
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