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

Unified Diff: base/test/test_support_android.cc

Issue 10896050: Android: Use external storage for test data. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: base/test/test_support_android.cc
diff --git a/base/test/test_support_android.cc b/base/test/test_support_android.cc
index 4dbc0cdbb7b3edc17e581f097ebdbc38192008a5..b55cedb773a9215120d9b81d4688689b8a4466be 100644
--- a/base/test/test_support_android.cc
+++ b/base/test/test_support_android.cc
@@ -5,6 +5,7 @@
#include <stdarg.h>
#include <string.h>
+#include "base/android/path_utils.h"
#include "base/file_path.h"
#include "base/logging.h"
#include "base/memory/singleton.h"
@@ -15,10 +16,6 @@
namespace {
-// The test implementation of AndroidOS stores everything in the following
-// directory.
-const char* kAndroidTestTempDirectory = "/data/local/tmp";
-
struct RunState {
RunState(base::MessagePump::Delegate* delegate, int run_depth)
: delegate(delegate),
@@ -141,15 +138,16 @@ base::MessagePump* CreateMessagePumpForUIStub() {
return new MessagePumpForUIStub();
};
-// Provides the test path for DIR_MODULE, DIR_CACHE and DIR_ANDROID_APP_DATA.
+// Provides the test path for DIR_MODULE and DIR_ANDROID_APP_DATA.
bool GetTestProviderPath(int key, FilePath* result) {
switch (key) {
case base::DIR_MODULE: {
- *result = FilePath(kAndroidTestTempDirectory);
+ *result = FilePath(base::android::GetExternalStorageDirectory());
return true;
}
case base::DIR_ANDROID_APP_DATA: {
- *result = FilePath(kAndroidTestTempDirectory);
+ // For tests we use external storage for app data.
Mark Mentovai 2012/08/30 02:52:29 Don’t say “we.”
nilesh 2012/08/30 17:21:55 Done.
+ *result = FilePath(base::android::GetExternalStorageDirectory());
return true;
}
default:
@@ -183,7 +181,6 @@ void InitAndroidTestLogging() {
void InitAndroidTestPaths() {
InitPathProvider(DIR_MODULE);
- InitPathProvider(DIR_CACHE);
InitPathProvider(DIR_ANDROID_APP_DATA);
}

Powered by Google App Engine
This is Rietveld 408576698