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

Unified Diff: base/test/test_support_android.cc

Issue 2044523003: Revert of 👔 Reland of Move side-loaded test data /sdcard -> /sdcard/gtestdata (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
« no previous file with comments | « base/test/test_support_android.h ('k') | build/android/pylib/local/device/local_device_gtest_run.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/test/test_support_android.cc
diff --git a/base/test/test_support_android.cc b/base/test/test_support_android.cc
index 4507ae4647f34dde5b3f7393234398359efbe3b6..f8441bd1ba5f9d75fe8e52258c6d339f24763514 100644
--- a/base/test/test_support_android.cc
+++ b/base/test/test_support_android.cc
@@ -17,8 +17,6 @@
#include "base/test/multiprocess_test.h"
namespace {
-
-base::FilePath* g_test_data_dir = nullptr;
struct RunState {
RunState(base::MessagePump::Delegate* delegate, int run_depth)
@@ -134,14 +132,13 @@
return std::unique_ptr<base::MessagePump>(new MessagePumpForUIStub());
};
-// Provides the test path for DIR_SOURCE_ROOT and DIR_ANDROID_APP_DATA.
+// Provides the test path for DIR_MODULE and DIR_ANDROID_APP_DATA.
bool GetTestProviderPath(int key, base::FilePath* result) {
switch (key) {
- case base::DIR_ANDROID_APP_DATA:
- case base::DIR_SOURCE_ROOT:
- CHECK(g_test_data_dir != nullptr);
- *result = *g_test_data_dir;
- return true;
+ case base::DIR_ANDROID_APP_DATA: {
+ // For tests, app data is put in external storage.
+ return base::android::GetExternalStorageDirectory(result);
+ }
default:
return false;
}
@@ -169,13 +166,8 @@
false); // Tick count
}
-void InitAndroidTestPaths(const FilePath& test_data_dir) {
- if (g_test_data_dir) {
- CHECK(test_data_dir == *g_test_data_dir);
- return;
- }
- g_test_data_dir = new FilePath(test_data_dir);
- InitPathProvider(DIR_SOURCE_ROOT);
+void InitAndroidTestPaths() {
+ InitPathProvider(DIR_MODULE);
InitPathProvider(DIR_ANDROID_APP_DATA);
}
@@ -187,6 +179,7 @@
void InitAndroidTest() {
if (!base::AndroidIsChildProcess()) {
InitAndroidTestLogging();
+ InitAndroidTestPaths();
}
InitAndroidTestMessageLoop();
}
« no previous file with comments | « base/test/test_support_android.h ('k') | build/android/pylib/local/device/local_device_gtest_run.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698