summaryrefslogtreecommitdiffstats
path: root/base/base_paths_posix.cc
diff options
context:
space:
mode:
authorjochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-03 23:10:04 +0000
committerjochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-03 23:10:04 +0000
commit569edabd9181aadba4f8e2e19cb5f41bab0866c7 (patch)
tree75c9fa61b325b7f896597f94f5d593a0fc4a024c /base/base_paths_posix.cc
parent2e81938acb4b5f01738caa35b4bdf5758450b186 (diff)
downloadchromium_src-569edabd9181aadba4f8e2e19cb5f41bab0866c7.zip
chromium_src-569edabd9181aadba4f8e2e19cb5f41bab0866c7.tar.gz
chromium_src-569edabd9181aadba4f8e2e19cb5f41bab0866c7.tar.bz2
Make GetWebKitRootDirFilePath smarter about where the WebKit root is relative to the chromium root
BUG=104605 TEST=can run layout tests in a webkit-only build on mac using make Review URL: http://codereview.chromium.org/8585029 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@120428 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/base_paths_posix.cc')
-rw-r--r--base/base_paths_posix.cc33
1 files changed, 5 insertions, 28 deletions
diff --git a/base/base_paths_posix.cc b/base/base_paths_posix.cc
index 14d17d6..a1c45a0 100644
--- a/base/base_paths_posix.cc
+++ b/base/base_paths_posix.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -29,10 +29,6 @@ namespace base {
const char kSelfExe[] = "/proc/self/exe";
#endif
-// The name of this file relative to the source root. This is used for checking
-// that the source checkout is in the correct place.
-static const char kThisSourceFile[] = "base/base_paths_posix.cc";
-
bool PathProviderPosix(int key, FilePath* result) {
FilePath path;
switch (key) {
@@ -84,40 +80,21 @@ bool PathProviderPosix(int key, FilePath* result) {
std::string cr_source_root;
if (env->GetVar("CR_SOURCE_ROOT", &cr_source_root)) {
path = FilePath(cr_source_root);
- if (file_util::PathExists(path.Append(kThisSourceFile))) {
+ if (file_util::PathExists(path)) {
*result = path;
return true;
} else {
DLOG(WARNING) << "CR_SOURCE_ROOT is set, but it appears to not "
- << "point to the correct source root directory.";
+ << "point to a directory.";
}
}
// On POSIX, unit tests execute two levels deep from the source root.
// For example: out/{Debug|Release}/net_unittest
if (PathService::Get(base::DIR_EXE, &path)) {
- path = path.DirName().DirName();
- if (file_util::PathExists(path.Append(kThisSourceFile))) {
- *result = path;
- return true;
- }
- }
- // In a case of WebKit-only checkout, executable files are put into
- // <root of checkout>/out/{Debug|Release}, and we should return
- // <root of checkout>/Source/WebKit/chromium for DIR_SOURCE_ROOT.
- if (PathService::Get(base::DIR_EXE, &path)) {
- path = path.DirName().DirName().Append("Source/WebKit/chromium");
- if (file_util::PathExists(path.Append(kThisSourceFile))) {
- *result = path;
- return true;
- }
- }
- // If that failed (maybe the build output is symlinked to a different
- // drive) try assuming the current directory is the source root.
- if (file_util::GetCurrentDirectory(&path) &&
- file_util::PathExists(path.Append(kThisSourceFile))) {
- *result = path;
+ *result = path.DirName().DirName();
return true;
}
+
DLOG(ERROR) << "Couldn't find your source root. "
<< "Try running from your chromium/src directory.";
return false;