diff options
author | thomasvl@chromium.org <thomasvl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-12 16:41:31 +0000 |
---|---|---|
committer | thomasvl@chromium.org <thomasvl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-12 16:41:31 +0000 |
commit | 7a38db66bdb64203e1322d777c7384cacd384496 (patch) | |
tree | e4baf501bfedd68e9f4e73ee4d5c0f0edfd3fa00 /chrome/common/chrome_paths.cc | |
parent | 8175e5a2570636d720e2e1edd84aa9c02938f22d (diff) | |
download | chromium_src-7a38db66bdb64203e1322d777c7384cacd384496.zip chromium_src-7a38db66bdb64203e1322d777c7384cacd384496.tar.gz chromium_src-7a38db66bdb64203e1322d777c7384cacd384496.tar.bz2 |
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
Diffstat (limited to 'chrome/common/chrome_paths.cc')
-rw-r--r-- | chrome/common/chrome_paths.cc | 18 |
1 files changed, 17 insertions, 1 deletions
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); } |