From 7a38db66bdb64203e1322d777c7384cacd384496 Mon Sep 17 00:00:00 2001 From: "thomasvl@chromium.org" Date: Fri, 12 Jun 2009 16:41:31 +0000 Subject: Make the logging dir on mac write outside the bundle in debug, this makes the file easier to find, and for unittests that try to scan it (like tab_switching), they then don't have to walk into the bundle. Compile tab_switching_test on mac/linux. Add a dep for app to tab_switching_test so building it also make sure the app is built (since it runs the app) Update tab_switching_test Use FilePath in all cases instead of wstring. Limit how long it will spin looking for the log log file so the test can't hang. TEST=the new test is built on mac/linux BUG=none Review URL: http://codereview.chromium.org/126049 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18277 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/common/chrome_paths.cc | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'chrome/common/chrome_paths.cc') diff --git a/chrome/common/chrome_paths.cc b/chrome/common/chrome_paths.cc index 4645346..f8188c2 100644 --- a/chrome/common/chrome_paths.cc +++ b/chrome/common/chrome_paths.cc @@ -8,6 +8,7 @@ #include "base/file_path.h" #include "base/file_util.h" #include "base/logging.h" +#include "base/mac_util.h" #include "base/path_service.h" #include "base/string_util.h" #include "base/sys_info.h" @@ -42,8 +43,23 @@ bool PathProvider(int key, FilePath* result) { return PathService::Get(chrome::DIR_USER_DATA, result); #else // Debug builds write next to the binary (in the build tree) +#if defined(OS_MACOSX) + if (!PathService::Get(base::DIR_EXE, result)) + return false; + if (mac_util::AmIBundled()) { + // If we're called from chrome, dump it beside the app (outside the + // app bundle), if we're called from a unittest, we'll already + // outside the bundle so use the exe dir. + // exe_dir gave us .../Chromium.app/Contents/MacOS/Chromium. + *result = result->DirName(); + *result = result->DirName(); + *result = result->DirName(); + } + return true; +#else return PathService::Get(base::DIR_EXE, result); -#endif +#endif // defined(OS_MACOSX) +#endif // NDEBUG case chrome::FILE_RESOURCE_MODULE: return PathService::Get(base::FILE_MODULE, result); } -- cgit v1.1