summaryrefslogtreecommitdiffstats
path: root/base/base_paths_win.cc
diff options
context:
space:
mode:
authortkent@chromium.org <tkent@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-15 06:53:52 +0000
committertkent@chromium.org <tkent@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-15 06:53:52 +0000
commit14a25e5040c14ac6760509693e971781cce21705 (patch)
treef66d204c0e8b0177b9bc4299cfe3423388d1d763 /base/base_paths_win.cc
parent8cff4c7cfbc5d1805a8e4a87fcd60bcab097dfd0 (diff)
downloadchromium_src-14a25e5040c14ac6760509693e971781cce21705.zip
chromium_src-14a25e5040c14ac6760509693e971781cce21705.tar.gz
chromium_src-14a25e5040c14ac6760509693e971781cce21705.tar.bz2
Support for DIR_SOURCE_ROOT in a case of WebKit-only checkout.
BUG=none TEST=none. It's hard to write tests for DIR_SOURCE_ROOT without DIR_SOURCE_ROOT. Review URL: http://codereview.chromium.org/2865002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49769 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/base_paths_win.cc')
-rw-r--r--base/base_paths_win.cc16
1 files changed, 13 insertions, 3 deletions
diff --git a/base/base_paths_win.cc b/base/base_paths_win.cc
index 47d7d4a..2b4912e 100644
--- a/base/base_paths_win.cc
+++ b/base/base_paths_win.cc
@@ -105,12 +105,22 @@ bool PathProviderWin(int key, FilePath* result) {
return false;
cur = FilePath(system_buffer);
break;
- case base::DIR_SOURCE_ROOT:
+ case base::DIR_SOURCE_ROOT: {
+ FilePath executableDir;
// On Windows, unit tests execute two levels deep from the source root.
// For example: chrome/{Debug|Release}/ui_tests.exe
- PathService::Get(base::DIR_EXE, &cur);
- cur = cur.DirName().DirName();
+ PathService::Get(base::DIR_EXE, &executableDir);
+ cur = executableDir.DirName().DirName();
+ FilePath checkedPath =
+ cur.Append(FILE_PATH_LITERAL("base/base_paths_win.cc"));
+ if (!file_util::PathExists(checkedPath)) {
+ // Check for WebKit-only checkout. Executable files are put into
+ // WebKit/WebKit/chromium/{Debug|Relese}, and we should return
+ // WebKit/WebKit/chromium.
+ cur = executableDir.DirName();
+ }
break;
+ }
default:
return false;
}