diff options
author | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-18 20:39:53 +0000 |
---|---|---|
committer | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-18 20:39:53 +0000 |
commit | 139c51038197965b0e010a1b4496829a6828310f (patch) | |
tree | 8de500aa117c8e76a4bc202a313c5a6d106cab91 | |
parent | 6f843de5729d1d43af02555fb28eb8957b48cc25 (diff) | |
download | chromium_src-139c51038197965b0e010a1b4496829a6828310f.zip chromium_src-139c51038197965b0e010a1b4496829a6828310f.tar.gz chromium_src-139c51038197965b0e010a1b4496829a6828310f.tar.bz2 |
components: Eliminate the dependency on chrome's kFrameworkName constant.
Hard coding this string directly on run_all_unittests.cc is the easiest
fix for now and allows us to get rid of this ugly dependency on chrome's
common target.
The right fix should come next with plist file and the
components_test.pak in place, otherwise is not possible to do remove
this dep.
So since alot of infrastructure is needed before we can get the right
fix, this was the minimal change that would allow us to get rid of it
soon rather than later, slowing local and remote builds for no good
reason.
BUG=34856
TEST=components_unittests on Mac works as before
R=blundell@chromium.org,thestig@chromium.org
Review URL: https://codereview.chromium.org/199653005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@257734 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/common/chrome_constants.h | 4 | ||||
-rw-r--r-- | components/components_tests.gyp | 6 | ||||
-rw-r--r-- | components/test/DEPS | 5 | ||||
-rw-r--r-- | components/test/run_all_unittests.cc | 24 |
4 files changed, 21 insertions, 18 deletions
diff --git a/chrome/common/chrome_constants.h b/chrome/common/chrome_constants.h index f2a6770..bebfdd6 100644 --- a/chrome/common/chrome_constants.h +++ b/chrome/common/chrome_constants.h @@ -24,6 +24,10 @@ extern const base::FilePath::CharType kHelperProcessExecutableNameChromium[]; extern const base::FilePath::CharType kBrowserProcessExecutablePathChromium[]; extern const base::FilePath::CharType kHelperProcessExecutablePathChromium[]; #if defined(OS_MACOSX) +// NOTE: if you change the value of kFrameworkName, please don't forget to +// update components/test/run_all_unittests.cc as well. +// TODO(tfarina): Remove the comment above, when you fix components to use plist +// on Mac. extern const base::FilePath::CharType kFrameworkName[]; // The helper .app bundle name and executable name may have one of these diff --git a/components/components_tests.gyp b/components/components_tests.gyp index 1fb6211..d15b5c7 100644 --- a/components/components_tests.gyp +++ b/components/components_tests.gyp @@ -297,12 +297,6 @@ ], }], ['OS == "mac"', { - 'dependencies': [ - # TODO(blundell): Eliminate this dependency by having - # ./test/run_all_unittests.cc avoid using the //chrome - # constant to get the framework name on OS X. crbug.com/348563 - '../chrome/chrome.gyp:common', - ], 'link_settings': { 'libraries': [ '$(SDKROOT)/System/Library/Frameworks/AddressBook.framework', diff --git a/components/test/DEPS b/components/test/DEPS index f0c8a87..25be319 100644 --- a/components/test/DEPS +++ b/components/test/DEPS @@ -5,9 +5,4 @@ include_rules = [ "+ui/base/ui_base_paths.h", "+ui/gfx/android/gfx_jni_registrar.h", "+ui/gl/gl_surface.h", # To initialize GL for tests. - - # TODO(blundell): Eliminate this dependency by having - # ./test/run_all_unittests.cc avoid using the //chrome - # constant to get the framework name on OS X. crbug.com/348563 - "!chrome/common/chrome_constants.h", ] diff --git a/components/test/run_all_unittests.cc b/components/test/run_all_unittests.cc index ee48eed..0e6dafa 100644 --- a/components/test/run_all_unittests.cc +++ b/components/test/run_all_unittests.cc @@ -14,10 +14,6 @@ #if defined(OS_MACOSX) #include "base/mac/bundle_locations.h" - -// TODO(blundell): Eliminate this dependency by having this file avoid using -// the //chrome constant to get the framework name on OS X. crbug.com/348563 -#include "chrome/common/chrome_constants.h" #endif #if !defined(OS_IOS) @@ -54,9 +50,18 @@ class ComponentsTestSuite : public base::TestSuite { base::FilePath path; PathService::Get(base::DIR_EXE, &path); - // TODO(blundell): Eliminate this dependency by having this file avoid using - // the //chrome constant to get the framework name on OS X. crbug.com/348563 - path = path.Append(chrome::kFrameworkName); + // TODO(tfarina): This is temporary. The right fix is to write a + // framework-Info.plist and integrate that into the build. + // Hardcode the framework name here to avoid having to depend on chrome's + // common target for chrome::kFrameworkName. +#if defined(GOOGLE_CHROME_BUILD) + path = path.AppendASCII("Google Chrome Framework.framework"); +#elif defined(CHROMIUM_BUILD) + path = path.AppendASCII("Chromium Framework.framework"); +#else +#error Unknown branding +#endif + base::mac::SetOverrideFrameworkBundlePath(path); #endif @@ -74,6 +79,11 @@ class ComponentsTestSuite : public base::TestSuite { virtual void Shutdown() OVERRIDE { ui::ResourceBundle::CleanupSharedInstance(); + +#if defined(OS_MACOSX) && !defined(OS_IOS) + base::mac::SetOverrideFrameworkBundle(NULL); +#endif + base::TestSuite::Shutdown(); } |