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

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

Issue 417943002: Revert of android tests: don't override DIR_MODULE (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 | « base/test/test_support_android.cc ('k') | components/url_fixer/url_fixer_unittest.cc » ('j') | 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 "chrome/common/chrome_paths.h" 5 #include "chrome/common/chrome_paths.h"
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/lazy_instance.h" 8 #include "base/lazy_instance.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/mac/bundle_locations.h" 10 #include "base/mac/bundle_locations.h"
11 #include "base/path_service.h" 11 #include "base/path_service.h"
12 #include "base/strings/string_util.h" 12 #include "base/strings/string_util.h"
13 #include "base/sys_info.h" 13 #include "base/sys_info.h"
14 #include "base/threading/thread_restrictions.h" 14 #include "base/threading/thread_restrictions.h"
15 #include "base/version.h" 15 #include "base/version.h"
16 #include "chrome/common/chrome_constants.h" 16 #include "chrome/common/chrome_constants.h"
17 #include "chrome/common/chrome_paths_internal.h" 17 #include "chrome/common/chrome_paths_internal.h"
18 #include "chrome/common/widevine_cdm_constants.h" 18 #include "chrome/common/widevine_cdm_constants.h"
19 #include "ui/base/ui_base_paths.h" 19 #include "ui/base/ui_base_paths.h"
20 20
21 #if defined(OS_ANDROID) 21 #if defined(OS_ANDROID)
22 #include "base/android/path_utils.h" 22 #include "base/android/path_utils.h"
23 #include "base/base_paths_android.h"
24 #endif 23 #endif
25 24
26 #if defined(OS_MACOSX) 25 #if defined(OS_MACOSX)
27 #include "base/mac/foundation_util.h" 26 #include "base/mac/foundation_util.h"
28 #endif 27 #endif
29 28
30 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. 29 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR.
31 30
32 namespace { 31 namespace {
33 32
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 case chrome::DIR_SUPERVISED_USERS_DEFAULT_APPS: 427 case chrome::DIR_SUPERVISED_USERS_DEFAULT_APPS:
429 if (!PathService::Get(chrome::DIR_STANDALONE_EXTERNAL_EXTENSIONS, &cur)) 428 if (!PathService::Get(chrome::DIR_STANDALONE_EXTERNAL_EXTENSIONS, &cur))
430 return false; 429 return false;
431 cur = cur.Append(FILE_PATH_LITERAL("managed_users")); 430 cur = cur.Append(FILE_PATH_LITERAL("managed_users"));
432 break; 431 break;
433 #endif 432 #endif
434 // The following are only valid in the development environment, and 433 // The following are only valid in the development environment, and
435 // will fail if executed from an installed executable (because the 434 // will fail if executed from an installed executable (because the
436 // generated path won't exist). 435 // generated path won't exist).
437 case chrome::DIR_GEN_TEST_DATA: 436 case chrome::DIR_GEN_TEST_DATA:
438 #if defined(OS_ANDROID)
439 // On Android, our tests don't have permission to write to DIR_MODULE.
440 // gtest/test_runner.py pushes data to external storage.
441 if (!PathService::Get(base::DIR_ANDROID_EXTERNAL_STORAGE, &cur))
442 return false;
443 #else
444 if (!PathService::Get(base::DIR_MODULE, &cur)) 437 if (!PathService::Get(base::DIR_MODULE, &cur))
445 return false; 438 return false;
446 #endif
447 cur = cur.Append(FILE_PATH_LITERAL("test_data")); 439 cur = cur.Append(FILE_PATH_LITERAL("test_data"));
448 if (!base::PathExists(cur)) // We don't want to create this. 440 if (!base::PathExists(cur)) // We don't want to create this.
449 return false; 441 return false;
450 break; 442 break;
451 case chrome::DIR_TEST_DATA: 443 case chrome::DIR_TEST_DATA:
452 if (!PathService::Get(base::DIR_SOURCE_ROOT, &cur)) 444 if (!PathService::Get(base::DIR_SOURCE_ROOT, &cur))
453 return false; 445 return false;
454 cur = cur.Append(FILE_PATH_LITERAL("chrome")); 446 cur = cur.Append(FILE_PATH_LITERAL("chrome"));
455 cur = cur.Append(FILE_PATH_LITERAL("test")); 447 cur = cur.Append(FILE_PATH_LITERAL("test"));
456 cur = cur.Append(FILE_PATH_LITERAL("data")); 448 cur = cur.Append(FILE_PATH_LITERAL("data"));
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
604 596
605 void SetInvalidSpecifiedUserDataDir(const base::FilePath& user_data_dir) { 597 void SetInvalidSpecifiedUserDataDir(const base::FilePath& user_data_dir) {
606 g_invalid_specified_user_data_dir.Get() = user_data_dir; 598 g_invalid_specified_user_data_dir.Get() = user_data_dir;
607 } 599 }
608 600
609 const base::FilePath& GetInvalidSpecifiedUserDataDir() { 601 const base::FilePath& GetInvalidSpecifiedUserDataDir() {
610 return g_invalid_specified_user_data_dir.Get(); 602 return g_invalid_specified_user_data_dir.Get();
611 } 603 }
612 604
613 } // namespace chrome 605 } // namespace chrome
OLDNEW
« no previous file with comments | « base/test/test_support_android.cc ('k') | components/url_fixer/url_fixer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698