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 "chrome/common/chrome_paths.h" | 5 #include "chrome/common/chrome_paths.h" |
6 | 6 |
7 #include "base/files/file_util.h" | 7 #include "base/files/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" |
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
437 cur = cur.Append(FILE_PATH_LITERAL("SupervisedUserInstalledWhitelists")); | 437 cur = cur.Append(FILE_PATH_LITERAL("SupervisedUserInstalledWhitelists")); |
438 break; | 438 break; |
439 #endif | 439 #endif |
440 // The following are only valid in the development environment, and | 440 // The following are only valid in the development environment, and |
441 // will fail if executed from an installed executable (because the | 441 // will fail if executed from an installed executable (because the |
442 // generated path won't exist). | 442 // generated path won't exist). |
443 case chrome::DIR_GEN_TEST_DATA: | 443 case chrome::DIR_GEN_TEST_DATA: |
444 #if defined(OS_ANDROID) | 444 #if defined(OS_ANDROID) |
445 // On Android, our tests don't have permission to write to DIR_MODULE. | 445 // On Android, our tests don't have permission to write to DIR_MODULE. |
446 // gtest/test_runner.py pushes data to external storage. | 446 // gtest/test_runner.py pushes data to external storage. |
447 if (!PathService::Get(base::DIR_SOURCE_ROOT, &cur)) | 447 if (!PathService::Get(base::DIR_ANDROID_EXTERNAL_STORAGE, &cur)) |
448 return false; | 448 return false; |
449 #else | 449 #else |
450 if (!PathService::Get(base::DIR_MODULE, &cur)) | 450 if (!PathService::Get(base::DIR_MODULE, &cur)) |
451 return false; | 451 return false; |
452 #endif | 452 #endif |
453 cur = cur.Append(FILE_PATH_LITERAL("test_data")); | 453 cur = cur.Append(FILE_PATH_LITERAL("test_data")); |
454 if (!base::PathExists(cur)) // We don't want to create this. | 454 if (!base::PathExists(cur)) // We don't want to create this. |
455 return false; | 455 return false; |
456 break; | 456 break; |
457 case chrome::DIR_TEST_DATA: | 457 case chrome::DIR_TEST_DATA: |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
592 | 592 |
593 void SetInvalidSpecifiedUserDataDir(const base::FilePath& user_data_dir) { | 593 void SetInvalidSpecifiedUserDataDir(const base::FilePath& user_data_dir) { |
594 g_invalid_specified_user_data_dir.Get() = user_data_dir; | 594 g_invalid_specified_user_data_dir.Get() = user_data_dir; |
595 } | 595 } |
596 | 596 |
597 const base::FilePath& GetInvalidSpecifiedUserDataDir() { | 597 const base::FilePath& GetInvalidSpecifiedUserDataDir() { |
598 return g_invalid_specified_user_data_dir.Get(); | 598 return g_invalid_specified_user_data_dir.Get(); |
599 } | 599 } |
600 | 600 |
601 } // namespace chrome | 601 } // namespace chrome |
OLD | NEW |