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

Side by Side Diff: chrome/common/chrome_paths.cc

Issue 8333013: Allow generator javascript test files to go anywhere in the source tree (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix escaping from windows file paths. Created 9 years, 2 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
OLDNEW
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 "chrome/common/chrome_paths.h" 5 #include "chrome/common/chrome_paths.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 case chrome::FILE_CHROMEOS_API: 273 case chrome::FILE_CHROMEOS_API:
274 if (!PathService::Get(base::DIR_MODULE, &cur)) 274 if (!PathService::Get(base::DIR_MODULE, &cur))
275 return false; 275 return false;
276 cur = cur.Append(FILE_PATH_LITERAL("chromeos")); 276 cur = cur.Append(FILE_PATH_LITERAL("chromeos"));
277 cur = cur.Append(FILE_PATH_LITERAL("libcros.so")); 277 cur = cur.Append(FILE_PATH_LITERAL("libcros.so"));
278 break; 278 break;
279 #endif 279 #endif
280 // The following are only valid in the development environment, and 280 // The following are only valid in the development environment, and
281 // will fail if executed from an installed executable (because the 281 // will fail if executed from an installed executable (because the
282 // generated path won't exist). 282 // generated path won't exist).
283 case chrome::DIR_GEN_TEST_DATA:
284 if (!PathService::Get(base::DIR_MODULE, &cur))
285 return false;
286 cur = cur.Append(FILE_PATH_LITERAL("test_data"));
287 if (!file_util::PathExists(cur)) // we don't want to create this
James Hawkins 2011/10/21 23:35:49 Capitalize sentence and add period.
Sheridan Rawlins 2011/10/22 00:09:11 Done.
288 return false;
289 break;
283 case chrome::DIR_TEST_DATA: 290 case chrome::DIR_TEST_DATA:
284 if (!PathService::Get(base::DIR_SOURCE_ROOT, &cur)) 291 if (!PathService::Get(base::DIR_SOURCE_ROOT, &cur))
285 return false; 292 return false;
286 cur = cur.Append(FILE_PATH_LITERAL("chrome")); 293 cur = cur.Append(FILE_PATH_LITERAL("chrome"));
287 cur = cur.Append(FILE_PATH_LITERAL("test")); 294 cur = cur.Append(FILE_PATH_LITERAL("test"));
288 cur = cur.Append(FILE_PATH_LITERAL("data")); 295 cur = cur.Append(FILE_PATH_LITERAL("data"));
289 if (!file_util::PathExists(cur)) // we don't want to create this 296 if (!file_util::PathExists(cur)) // we don't want to create this
290 return false; 297 return false;
291 break; 298 break;
292 case chrome::DIR_TEST_TOOLS: 299 case chrome::DIR_TEST_TOOLS:
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 return true; 393 return true;
387 } 394 }
388 395
389 // This cannot be done as a static initializer sadly since Visual Studio will 396 // This cannot be done as a static initializer sadly since Visual Studio will
390 // eliminate this object file if there is no direct entry point into it. 397 // eliminate this object file if there is no direct entry point into it.
391 void RegisterPathProvider() { 398 void RegisterPathProvider() {
392 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END); 399 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END);
393 } 400 }
394 401
395 } // namespace chrome 402 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698