Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Side by Side Diff: content/common/content_paths.cc

Issue 9186033: Swap fallback order to search LayoutTests directory (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 21 matching lines...) Expand all
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: { 40 case DIR_LAYOUT_TESTS: {
41 FilePath cur; 41 FilePath cur;
42 if (!PathService::Get(DIR_TEST_DATA, &cur))
43 return false;
44 cur = cur.Append(FILE_PATH_LITERAL("layout_tests"));
45 cur = cur.Append(FILE_PATH_LITERAL("LayoutTests"));
M-A Ruel 2012/06/20 19:42:59 It's been 2 months and content/test/data/layout_te
jabdelmalek 2012/06/20 19:55:34 It would be nice to check these into content/test/
46 if (file_util::DirectoryExists(cur)) {
47 *result = cur;
48 return true;
49 }
42 if (!PathService::Get(base::DIR_SOURCE_ROOT, &cur)) 50 if (!PathService::Get(base::DIR_SOURCE_ROOT, &cur))
43 return false; 51 return false;
44 cur = cur.Append(FILE_PATH_LITERAL("third_party")); 52 cur = cur.Append(FILE_PATH_LITERAL("third_party"));
45 cur = cur.Append(FILE_PATH_LITERAL("WebKit")); 53 cur = cur.Append(FILE_PATH_LITERAL("WebKit"));
46 cur = cur.Append(FILE_PATH_LITERAL("LayoutTests")); 54 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; 55 *result = cur;
56 return true; 56 return true;
57 } 57 }
58 default: 58 default:
59 return false; 59 return false;
60 } 60 }
61 61
62 return false; 62 return false;
63 } 63 }
64 64
65 // 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
66 // 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.
67 void RegisterPathProvider() { 67 void RegisterPathProvider() {
68 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END); 68 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END);
69 } 69 }
70 70
71 } // namespace content 71 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698