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

Side by Side Diff: base/base_paths_android.cc

Issue 1926793002: 👔 Move side-loaded test data /sdcard -> /sdcard/gtestdata (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix cast compile Created 4 years, 7 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
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 // Defines base::PathProviderAndroid which replaces base::PathProviderPosix for 5 // Defines base::PathProviderAndroid which replaces base::PathProviderPosix for
6 // Android in base/path_service.cc. 6 // Android in base/path_service.cc.
7 7
8 #include <limits.h> 8 #include <limits.h>
9 #include <unistd.h> 9 #include <unistd.h>
10 10
(...skipping 22 matching lines...) Expand all
33 return true; 33 return true;
34 } 34 }
35 case base::FILE_MODULE: 35 case base::FILE_MODULE:
36 // dladdr didn't work in Android as only the file name was returned. 36 // dladdr didn't work in Android as only the file name was returned.
37 NOTIMPLEMENTED(); 37 NOTIMPLEMENTED();
38 return false; 38 return false;
39 case base::DIR_MODULE: 39 case base::DIR_MODULE:
40 return base::android::GetNativeLibraryDirectory(result); 40 return base::android::GetNativeLibraryDirectory(result);
41 case base::DIR_SOURCE_ROOT: 41 case base::DIR_SOURCE_ROOT:
42 // This const is only used for tests. 42 // This const is only used for tests.
43 return base::android::GetExternalStorageDirectory(result); 43 if (!base::android::GetExternalStorageDirectory(result))
44 return false;
45 *result = result->Append(FILE_PATH_LITERAL("gtestdata"));
jbudorick 2016/04/27 19:59:01 What's the motivation behind putting this in "gtes
jbudorick 2016/04/27 20:00:30 (also, in the event we keep it, "gtestdata" is a b
agrieve 2016/04/27 20:26:31 chromium_test_root?
agrieve 2016/04/27 20:26:31 It's to avoid wiping the entire /sdcard when runni
jbudorick 2016/04/27 20:41:36 eh, I'd rather have our own sdcard subdirectory th
46 return true;
44 case base::DIR_USER_DESKTOP: 47 case base::DIR_USER_DESKTOP:
45 // Android doesn't support GetUserDesktop. 48 // Android doesn't support GetUserDesktop.
46 NOTIMPLEMENTED(); 49 NOTIMPLEMENTED();
47 return false; 50 return false;
48 case base::DIR_CACHE: 51 case base::DIR_CACHE:
49 return base::android::GetCacheDirectory(result); 52 return base::android::GetCacheDirectory(result);
50 case base::DIR_ANDROID_APP_DATA: 53 case base::DIR_ANDROID_APP_DATA:
51 return base::android::GetDataDirectory(result); 54 return base::android::GetDataDirectory(result);
52 case base::DIR_ANDROID_EXTERNAL_STORAGE: 55 case base::DIR_ANDROID_EXTERNAL_STORAGE:
53 return base::android::GetExternalStorageDirectory(result); 56 return base::android::GetExternalStorageDirectory(result);
54 default: 57 default:
55 // Note: the path system expects this function to override the default 58 // Note: the path system expects this function to override the default
56 // behavior. So no need to log an error if we don't support a given 59 // behavior. So no need to log an error if we don't support a given
57 // path. The system will just use the default. 60 // path. The system will just use the default.
58 return false; 61 return false;
59 } 62 }
60 } 63 }
61 64
62 } // namespace base 65 } // namespace base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698