OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // This class sets up the environment for running the content browser tests | 5 // This class sets up the environment for running the content browser tests |
6 // inside an android application. | 6 // inside an android application. |
7 | 7 |
8 #include <android/log.h> | 8 #include <android/log.h> |
9 | 9 |
10 #include "base/android/base_jni_registrar.h" | 10 #include "base/android/base_jni_registrar.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 RemoveChars(tokenizer.token(), "\"", &token); | 37 RemoveChars(tokenizer.token(), "\"", &token); |
38 args->push_back(token); | 38 args->push_back(token); |
39 } | 39 } |
40 } | 40 } |
41 | 41 |
42 void ParseArgsFromCommandLineFile(std::vector<std::string>* args) { | 42 void ParseArgsFromCommandLineFile(std::vector<std::string>* args) { |
43 // The test runner script writes the command line file in | 43 // The test runner script writes the command line file in |
44 // "/data/local/tmp". | 44 // "/data/local/tmp". |
45 static const char kCommandLineFilePath[] = | 45 static const char kCommandLineFilePath[] = |
46 "/data/local/tmp/content-browser-tests-command-line"; | 46 "/data/local/tmp/content-browser-tests-command-line"; |
47 FilePath command_line(kCommandLineFilePath); | 47 base::FilePath command_line(kCommandLineFilePath); |
48 std::string command_line_string; | 48 std::string command_line_string; |
49 if (file_util::ReadFileToString(command_line, &command_line_string)) { | 49 if (file_util::ReadFileToString(command_line, &command_line_string)) { |
50 ParseArgsFromString(command_line_string, args); | 50 ParseArgsFromString(command_line_string, args); |
51 } | 51 } |
52 } | 52 } |
53 | 53 |
54 int ArgsToArgv(const std::vector<std::string>& args, | 54 int ArgsToArgv(const std::vector<std::string>& args, |
55 std::vector<char*>* argv) { | 55 std::vector<char*>* argv) { |
56 // We need to pass in a non-const char**. | 56 // We need to pass in a non-const char**. |
57 int argc = args.size(); | 57 int argc = args.size(); |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 return -1; | 118 return -1; |
119 | 119 |
120 if (!content::android::RegisterShellJni(env)) | 120 if (!content::android::RegisterShellJni(env)) |
121 return -1; | 121 return -1; |
122 | 122 |
123 if (!RegisterNativesImpl(env)) | 123 if (!RegisterNativesImpl(env)) |
124 return -1; | 124 return -1; |
125 | 125 |
126 return JNI_VERSION_1_4; | 126 return JNI_VERSION_1_4; |
127 } | 127 } |
OLD | NEW |