summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authortony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-22 05:28:06 +0000
committertony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-22 05:28:06 +0000
commit998e51f6531af4f086aaaf5a43373f06b8dbcbe5 (patch)
tree1bda6def7e69d4adeb0d57219ab59325974389e2 /app
parent1958e0ef0fe59e392cab9bb351401beeb64e8379 (diff)
downloadchromium_src-998e51f6531af4f086aaaf5a43373f06b8dbcbe5.zip
chromium_src-998e51f6531af4f086aaaf5a43373f06b8dbcbe5.tar.gz
chromium_src-998e51f6531af4f086aaaf5a43373f06b8dbcbe5.tar.bz2
Remove app.gyp dependency on chrome.gyp.
The problem is that app_unittests tries to use pak files generated by chrome.gyp. Instead, create new .pak files in app_unittest_strings and have app_unittests use those pak files instead. Review URL: http://codereview.chromium.org/1748004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45294 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'app')
-rw-r--r--app/app.gyp43
-rw-r--r--app/app_paths.cc10
-rw-r--r--app/app_paths.h3
-rw-r--r--app/resource_bundle_linux.cc6
-rw-r--r--app/test_suite.h9
5 files changed, 65 insertions, 6 deletions
diff --git a/app/app.gyp b/app/app.gyp
index 86afe36..893af8d 100644
--- a/app/app.gyp
+++ b/app/app.gyp
@@ -58,10 +58,10 @@
'..',
],
'conditions': [
- ['OS=="linux" or OS=="freebsd" or OS=="openbsd"', {
+ ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris"', {
'dependencies': [
+ 'app_unittest_strings',
'../build/linux/system.gyp:gtk',
- '../chrome/chrome.gyp:packed_resources',
'../tools/xdisplaycheck/xdisplaycheck.gyp:xdisplaycheck',
],
}],
@@ -157,6 +157,45 @@
],
},
],
+ 'conditions': [
+ ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris"', {
+ 'targets': [{
+ 'target_name': 'app_unittest_strings',
+ 'type': 'none',
+ 'variables': {
+ 'repack_path': '<(DEPTH)/tools/data_pack/repack.py',
+ },
+ 'actions': [
+ {
+ 'action_name': 'repack_app_unittest_strings',
+ 'variables': {
+ 'pak_inputs': [
+ '<(grit_out_dir)/app_strings/app_strings_en-US.pak',
+ '<(grit_out_dir)/app_locale_settings/app_locale_settings_en-US.pak',
+ ],
+ },
+ 'inputs': [
+ '<(repack_path)',
+ '<@(pak_inputs)',
+ ],
+ 'outputs': [
+ '<(PRODUCT_DIR)/app_unittests_strings/en-US.pak',
+ ],
+ 'action': ['python', '<(repack_path)', '<@(_outputs)',
+ '<@(pak_inputs)'],
+ },
+ ],
+ 'copies': [
+ {
+ 'destination': '<(PRODUCT_DIR)/app_unittests_strings',
+ 'files': [
+ '<(grit_out_dir)/app_resources/app_resources.pak',
+ ],
+ },
+ ],
+ }],
+ }],
+ ],
}
# Local Variables:
diff --git a/app/app_paths.cc b/app/app_paths.cc
index 315efec8..0007a10 100644
--- a/app/app_paths.cc
+++ b/app/app_paths.cc
@@ -55,6 +55,16 @@ bool PathProvider(int key, FilePath* result) {
create_dir = true;
#endif
break;
+ case app::FILE_RESOURCES_PAK:
+#if defined(OS_LINUX)
+ if (!PathService::Get(base::DIR_EXE, &cur))
+ return false;
+ // TODO(tony): We shouldn't be referencing chrome here.
+ cur = cur.AppendASCII("chrome.pak");
+#else
+ NOTREACHED();
+#endif
+ break;
// The following are only valid in the development environment, and
// will fail if executed from an installed executable (because the
// generated path won't exist).
diff --git a/app/app_paths.h b/app/app_paths.h
index 3f97feb..250e6bf 100644
--- a/app/app_paths.h
+++ b/app/app_paths.h
@@ -17,6 +17,9 @@ enum {
DIR_LOCALES, // Directory where locale resources are stored.
DIR_EXTERNAL_EXTENSIONS, // Directory where installer places .crx files.
+ FILE_RESOURCES_PAK, // Path to the data .pak file which holds binary
+ // resources.
+
// Valid only in development environment; TODO(darin): move these
DIR_TEST_DATA, // Directory where unit test data resides.
diff --git a/app/resource_bundle_linux.cc b/app/resource_bundle_linux.cc
index 9f0fd56..7ebe4e6 100644
--- a/app/resource_bundle_linux.cc
+++ b/app/resource_bundle_linux.cc
@@ -67,10 +67,8 @@ void ResourceBundle::FreeGdkPixBufs() {
// static
FilePath ResourceBundle::GetResourcesFilePath() {
FilePath resources_file_path;
- PathService::Get(base::DIR_EXE, &resources_file_path);
- if (resources_file_path.empty())
- return resources_file_path;
- return resources_file_path.Append(FILE_PATH_LITERAL("chrome.pak"));
+ PathService::Get(app::FILE_RESOURCES_PAK, &resources_file_path);
+ return resources_file_path;
}
// static
diff --git a/app/test_suite.h b/app/test_suite.h
index 061dc9c..3a738b2 100644
--- a/app/test_suite.h
+++ b/app/test_suite.h
@@ -48,6 +48,15 @@ class AppTestSuite : public TestSuite {
mac_util::SetOverrideAppBundlePath(path);
#endif // OS_MACOSX
+#if defined(OS_LINUX)
+ FilePath pak_dir;
+ PathService::Get(base::DIR_MODULE, &pak_dir);
+ pak_dir = pak_dir.AppendASCII("app_unittests_strings");
+ PathService::Override(app::DIR_LOCALES, pak_dir);
+ PathService::Override(app::FILE_RESOURCES_PAK,
+ pak_dir.AppendASCII("app_resources.pak"));
+#endif // OS_LINUX
+
// Force unittests to run using en-US so if we test against string
// output, it'll pass regardless of the system language.
ResourceBundle::InitSharedInstance(L"en-US");