summaryrefslogtreecommitdiffstats
path: root/testing
diff options
context:
space:
mode:
authornileshagrawal@chromium.org <nileshagrawal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-16 05:50:18 +0000
committernileshagrawal@chromium.org <nileshagrawal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-16 05:50:18 +0000
commite094256d424f78bbc42c4e6d0b3ea93813b426b4 (patch)
tree65876e56e8cf1218eb11173f350bcbefc80a9712 /testing
parent19845b043af3e773fef859740a126632aba98c5f (diff)
downloadchromium_src-e094256d424f78bbc42c4e6d0b3ea93813b426b4.zip
chromium_src-e094256d424f78bbc42c4e6d0b3ea93813b426b4.tar.gz
chromium_src-e094256d424f78bbc42c4e6d0b3ea93813b426b4.tar.bz2
Put commandline for apk tests in /data/local/tmp
We were trying to use the application directory which is not usually writable (unless the device is rooted). This allows us to run the tests on non-rooted devices. BUG=125059 TEST= Review URL: https://chromiumcodereview.appspot.com/10398049 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@137368 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'testing')
-rw-r--r--testing/android/native_test_launcher.cc14
1 files changed, 7 insertions, 7 deletions
diff --git a/testing/android/native_test_launcher.cc b/testing/android/native_test_launcher.cc
index ad1db27..d8caaaa 100644
--- a/testing/android/native_test_launcher.cc
+++ b/testing/android/native_test_launcher.cc
@@ -73,10 +73,11 @@ void ParseArgsFromString(const std::string& command_line,
}
}
-void ParseArgsFromCommandLineFile(const FilePath& internal_data_path,
- std::vector<std::string>* args) {
- static const char kCommandLineFile[] = "chrome-native-tests-command-line";
- FilePath command_line(internal_data_path.Append(FilePath(kCommandLineFile)));
+void ParseArgsFromCommandLineFile(std::vector<std::string>* args) {
+ // The test runner script can write to "/data/local/tmp".
+ static const char kCommandLineFilePath[] =
+ "/data/local/tmp/chrome-native-tests-command-line";
+ FilePath command_line(kCommandLineFilePath);
std::string command_line_string;
if (file_util::ReadFileToString(command_line, &command_line_string)) {
ParseArgsFromString(command_line_string, args);
@@ -166,8 +167,7 @@ void LibraryLoadedOnMainThread(JNIEnv* env) {
// internal gtest data structures based on the command line.
// It needs to be scoped as it also resets the CommandLine.
std::vector<std::string> args;
- FilePath path("/data/user/0/org.chromium.native_test/files/");
- ParseArgsFromCommandLineFile(path, &args);
+ ParseArgsFromCommandLineFile(&args);
std::vector<char*> argv;
ArgsToArgv(args, &argv);
base::TestSuite test_suite(argv.size(), &argv[0]);
@@ -206,7 +206,7 @@ static void RunTests(JNIEnv* env,
freopen(stdout_path.value().c_str(), "w", stdout);
std::vector<std::string> args;
- ParseArgsFromCommandLineFile(files_dir, &args);
+ ParseArgsFromCommandLineFile(&args);
// We need to pass in a non-const char**.
std::vector<char*> argv;