| 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 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 411 cur = cur.Append(FILE_PATH_LITERAL("SupervisedUserInstalledWhitelists")); | 411 cur = cur.Append(FILE_PATH_LITERAL("SupervisedUserInstalledWhitelists")); |
| 412 break; | 412 break; |
| 413 #endif | 413 #endif |
| 414 // The following are only valid in the development environment, and | 414 // The following are only valid in the development environment, and |
| 415 // will fail if executed from an installed executable (because the | 415 // will fail if executed from an installed executable (because the |
| 416 // generated path won't exist). | 416 // generated path won't exist). |
| 417 case chrome::DIR_GEN_TEST_DATA: | 417 case chrome::DIR_GEN_TEST_DATA: |
| 418 #if defined(OS_ANDROID) | 418 #if defined(OS_ANDROID) |
| 419 // On Android, our tests don't have permission to write to DIR_MODULE. | 419 // On Android, our tests don't have permission to write to DIR_MODULE. |
| 420 // gtest/test_runner.py pushes data to external storage. | 420 // gtest/test_runner.py pushes data to external storage. |
| 421 if (!PathService::Get(base::DIR_ANDROID_EXTERNAL_STORAGE, &cur)) | 421 if (!PathService::Get(base::DIR_SOURCE_ROOT, &cur)) |
| 422 return false; | 422 return false; |
| 423 #else | 423 #else |
| 424 if (!PathService::Get(base::DIR_MODULE, &cur)) | 424 if (!PathService::Get(base::DIR_MODULE, &cur)) |
| 425 return false; | 425 return false; |
| 426 #endif | 426 #endif |
| 427 cur = cur.Append(FILE_PATH_LITERAL("test_data")); | 427 cur = cur.Append(FILE_PATH_LITERAL("test_data")); |
| 428 if (!base::PathExists(cur)) // We don't want to create this. | 428 if (!base::PathExists(cur)) // We don't want to create this. |
| 429 return false; | 429 return false; |
| 430 break; | 430 break; |
| 431 case chrome::DIR_TEST_DATA: | 431 case chrome::DIR_TEST_DATA: |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 566 | 566 |
| 567 void SetInvalidSpecifiedUserDataDir(const base::FilePath& user_data_dir) { | 567 void SetInvalidSpecifiedUserDataDir(const base::FilePath& user_data_dir) { |
| 568 g_invalid_specified_user_data_dir.Get() = user_data_dir; | 568 g_invalid_specified_user_data_dir.Get() = user_data_dir; |
| 569 } | 569 } |
| 570 | 570 |
| 571 const base::FilePath& GetInvalidSpecifiedUserDataDir() { | 571 const base::FilePath& GetInvalidSpecifiedUserDataDir() { |
| 572 return g_invalid_specified_user_data_dir.Get(); | 572 return g_invalid_specified_user_data_dir.Get(); |
| 573 } | 573 } |
| 574 | 574 |
| 575 } // namespace chrome | 575 } // namespace chrome |
| OLD | NEW |