OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/base_paths_mac.h" | 5 #include "base/base_paths_mac.h" |
6 | 6 |
7 #include <dlfcn.h> | 7 #include <dlfcn.h> |
8 #import <Foundation/Foundation.h> | 8 #import <Foundation/Foundation.h> |
9 #include <mach-o/dyld.h> | 9 #include <mach-o/dyld.h> |
10 | 10 |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "base/file_path.h" | 12 #include "base/file_path.h" |
13 #include "base/file_util.h" | 13 #include "base/file_util.h" |
14 #include "base/logging.h" | 14 #include "base/logging.h" |
15 #include "base/mac/bundle_locations.h" | |
15 #include "base/mac/foundation_util.h" | 16 #include "base/mac/foundation_util.h" |
16 #include "base/path_service.h" | 17 #include "base/path_service.h" |
17 #include "base/string_util.h" | 18 #include "base/string_util.h" |
18 | 19 |
19 namespace { | 20 namespace { |
20 | 21 |
21 void GetNSExecutablePath(FilePath* path) { | 22 void GetNSExecutablePath(FilePath* path) { |
22 DCHECK(path); | 23 DCHECK(path); |
23 // Executable path can have relative references ("..") depending on | 24 // Executable path can have relative references ("..") depending on |
24 // how the app was launched. | 25 // how the app was launched. |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
73 // levels down, eg: | 74 // levels down, eg: |
74 // src/xcodebuild/{Debug|Release}/Chromium.app/Contents/MacOS/Chromium | 75 // src/xcodebuild/{Debug|Release}/Chromium.app/Contents/MacOS/Chromium |
75 *result = result->DirName().DirName().DirName().DirName().DirName(); | 76 *result = result->DirName().DirName().DirName().DirName().DirName(); |
76 } else { | 77 } else { |
77 // Unit tests execute two levels deep from the source root, eg: | 78 // Unit tests execute two levels deep from the source root, eg: |
78 // src/xcodebuild/{Debug|Release}/base_unittests | 79 // src/xcodebuild/{Debug|Release}/base_unittests |
79 *result = result->DirName().DirName(); | 80 *result = result->DirName().DirName(); |
80 } | 81 } |
81 return true; | 82 return true; |
82 } | 83 } |
84 case base::DIR_MEDIA_LIBS: { | |
vrk (LEFT CHROMIUM)
2012/03/06 02:07:50
This is failing the base_unittests PathServiceTest
scherkus (not reviewing)
2012/03/06 02:19:00
my only guess would be that ReturnsValidPath() is
| |
85 *result = base::mac::FrameworkBundlePath(); | |
86 *result = result->Append("Libraries"); | |
87 return true; | |
88 } | |
83 default: | 89 default: |
84 return false; | 90 return false; |
85 } | 91 } |
86 } | 92 } |
87 | 93 |
88 } // namespace base | 94 } // namespace base |
OLD | NEW |