summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authortc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-18 20:40:04 +0000
committertc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-18 20:40:04 +0000
commit4fa725ecd63006b46f2693f219a10a7c62e1a617 (patch)
tree90aa4f8d5725c623fd7ecd068cafca3b819b87af /base
parent2b799eee4408951d90d1c6be505491c2f40f5673 (diff)
downloadchromium_src-4fa725ecd63006b46f2693f219a10a7c62e1a617.zip
chromium_src-4fa725ecd63006b46f2693f219a10a7c62e1a617.tar.gz
chromium_src-4fa725ecd63006b46f2693f219a10a7c62e1a617.tar.bz2
Make some net unittests compile and pass on linux.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@991 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r--base/base_paths_linux.cc11
-rw-r--r--base/base_paths_linux.h3
2 files changed, 14 insertions, 0 deletions
diff --git a/base/base_paths_linux.cc b/base/base_paths_linux.cc
index 69c9078..298c231 100644
--- a/base/base_paths_linux.cc
+++ b/base/base_paths_linux.cc
@@ -31,12 +31,15 @@
#include <unistd.h>
+#include "base/file_util.h"
#include "base/logging.h"
+#include "base/path_service.h"
#include "base/sys_string_conversions.h"
namespace base {
bool PathProviderLinux(int key, std::wstring* result) {
+ std::wstring cur;
switch (key) {
case base::FILE_EXE:
case base::FILE_MODULE: { // TODO(evanm): is this correct?
@@ -50,6 +53,14 @@ bool PathProviderLinux(int key, std::wstring* result) {
*result = base::SysNativeMBToWide(bin_dir);
return true;
}
+ case base::DIR_SOURCE_ROOT:
+ // On linux, unit tests execute two levels deep from the source root.
+ // For example: chrome/{Debug|Hammer}/net_unittest
+ PathService::Get(base::DIR_EXE, &cur);
+ file_util::UpOneDirectory(&cur);
+ file_util::UpOneDirectory(&cur);
+ *result = cur;
+ return true;
}
return false;
}
diff --git a/base/base_paths_linux.h b/base/base_paths_linux.h
index b0f3d48..0ba3a19 100644
--- a/base/base_paths_linux.h
+++ b/base/base_paths_linux.h
@@ -43,6 +43,9 @@ enum {
FILE_MODULE, // Path and filename of the module containing the code for the
// PathService (which could differ from FILE_EXE if the
// PathService were compiled into a shared object, for example).
+ DIR_SOURCE_ROOT, // Returns the root of the source tree. This key is useful
+ // for tests that need to locate various resources. It
+ // should not be used outside of test code.
PATH_LINUX_END
};