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