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

Unified Diff: chrome/common/chrome_paths.cc

Issue 411253010: android tests: don't override DIR_MODULE (take 2) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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.cc ('k') | components/url_fixer/url_fixer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/chrome_paths.cc
diff --git a/chrome/common/chrome_paths.cc b/chrome/common/chrome_paths.cc
index 6960bf3c61e3bd02a701c4c3d91821208cfcf337..df5df2fa479feaa878185b5847e23e1d9066bc0d 100644
--- a/chrome/common/chrome_paths.cc
+++ b/chrome/common/chrome_paths.cc
@@ -20,6 +20,7 @@
#if defined(OS_ANDROID)
#include "base/android/path_utils.h"
+#include "base/base_paths_android.h"
#endif
#if defined(OS_MACOSX)
@@ -434,8 +435,15 @@ bool PathProvider(int key, base::FilePath* result) {
// will fail if executed from an installed executable (because the
// generated path won't exist).
case chrome::DIR_GEN_TEST_DATA:
+#if defined(OS_ANDROID)
+ // On Android, our tests don't have permission to write to DIR_MODULE.
+ // gtest/test_runner.py pushes data to external storage.
+ if (!PathService::Get(base::DIR_ANDROID_EXTERNAL_STORAGE, &cur))
+ return false;
+#else
if (!PathService::Get(base::DIR_MODULE, &cur))
return false;
+#endif
cur = cur.Append(FILE_PATH_LITERAL("test_data"));
if (!base::PathExists(cur)) // We don't want to create this.
return false;
« no previous file with comments | « base/test/test_support_android.cc ('k') | components/url_fixer/url_fixer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698