Commit 9b64ef2c authored by tim@chromium.org's avatar tim@chromium.org

android tests: don't override DIR_MODULE

BUG=
R=brettw@chromium.org, nyquist@chromium.org, phajdan.jr@chromium.org, sky@chromium.org

Review URL: https://codereview.chromium.org/408063002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@285096 0039d316-1c4b-4281-b951-d872f2087c98
parent f2242183
......@@ -140,9 +140,6 @@ scoped_ptr<base::MessagePump> CreateMessagePumpForUIStub() {
// Provides the test path for DIR_MODULE and DIR_ANDROID_APP_DATA.
bool GetTestProviderPath(int key, base::FilePath* result) {
switch (key) {
case base::DIR_MODULE: {
return base::android::GetExternalStorageDirectory(result);
}
case base::DIR_ANDROID_APP_DATA: {
// For tests, app data is put in external storage.
return base::android::GetExternalStorageDirectory(result);
......
......@@ -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;
......
......@@ -354,7 +354,7 @@ TEST(URLFixerTest, FixupFile) {
// this "original" filename is the one we tweak to get all the variations
base::FilePath dir;
base::FilePath original;
ASSERT_TRUE(PathService::Get(base::DIR_MODULE, &dir));
ASSERT_TRUE(PathService::Get(base::DIR_TEST_DATA, &dir));
ASSERT_TRUE(MakeTempFile(
dir,
base::FilePath(FILE_PATH_LITERAL("url fixer upper existing file.txt")),
......@@ -438,7 +438,7 @@ TEST(URLFixerTest, FixupRelativeFile) {
base::FilePath full_path, dir;
base::FilePath file_part(
FILE_PATH_LITERAL("url_fixer_upper_existing_file.txt"));
ASSERT_TRUE(PathService::Get(base::DIR_MODULE, &dir));
ASSERT_TRUE(PathService::Get(base::DIR_TEST_DATA, &dir));
ASSERT_TRUE(MakeTempFile(dir, file_part, &full_path));
full_path = base::MakeAbsoluteFilePath(full_path);
ASSERT_FALSE(full_path.empty());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment