OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/public/common/content_paths.h" | 5 #include "content/public/common/content_paths.h" |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/mac/bundle_locations.h" | 8 #include "base/mac/bundle_locations.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 | 10 |
(...skipping 19 matching lines...) Expand all Loading... |
30 } | 30 } |
31 case DIR_MEDIA_LIBS: { | 31 case DIR_MEDIA_LIBS: { |
32 #if defined(OS_MACOSX) | 32 #if defined(OS_MACOSX) |
33 *result = base::mac::FrameworkBundlePath(); | 33 *result = base::mac::FrameworkBundlePath(); |
34 *result = result->Append("Libraries"); | 34 *result = result->Append("Libraries"); |
35 return true; | 35 return true; |
36 #else | 36 #else |
37 return PathService::Get(base::DIR_MODULE, result); | 37 return PathService::Get(base::DIR_MODULE, result); |
38 #endif | 38 #endif |
39 } | 39 } |
| 40 case DIR_LAYOUT_TESTS: { |
| 41 FilePath cur; |
| 42 if (!PathService::Get(base::DIR_SOURCE_ROOT, &cur)) |
| 43 return false; |
| 44 cur = cur.Append(FILE_PATH_LITERAL("third_party")); |
| 45 cur = cur.Append(FILE_PATH_LITERAL("WebKit")); |
| 46 cur = cur.Append(FILE_PATH_LITERAL("LayoutTests")); |
| 47 if (file_util::DirectoryExists(cur)) { |
| 48 *result = cur; |
| 49 return true; |
| 50 } |
| 51 if (!PathService::Get(DIR_TEST_DATA, &cur)) |
| 52 return false; |
| 53 cur = cur.Append(FILE_PATH_LITERAL("layout_tests")); |
| 54 cur = cur.Append(FILE_PATH_LITERAL("LayoutTests")); |
| 55 *result = cur; |
| 56 return true; |
| 57 } |
40 default: | 58 default: |
41 return false; | 59 return false; |
42 } | 60 } |
43 | 61 |
44 return false; | 62 return false; |
45 } | 63 } |
46 | 64 |
47 // This cannot be done as a static initializer sadly since Visual Studio will | 65 // This cannot be done as a static initializer sadly since Visual Studio will |
48 // eliminate this object file if there is no direct entry point into it. | 66 // eliminate this object file if there is no direct entry point into it. |
49 void RegisterPathProvider() { | 67 void RegisterPathProvider() { |
50 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END); | 68 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END); |
51 } | 69 } |
52 | 70 |
53 } // namespace content | 71 } // namespace content |
OLD | NEW |