| 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 native tests inside an | 5 // This class sets up the environment for running the native tests inside an |
| 6 // android application. It outputs (to a fifo) markers identifying the | 6 // android application. It outputs (to a fifo) markers identifying the |
| 7 // START/PASSED/CRASH of the test suite, FAILURE/SUCCESS of individual tests, | 7 // START/PASSED/CRASH of the test suite, FAILURE/SUCCESS of individual tests, |
| 8 // etc. | 8 // etc. |
| 9 // These markers are read by the test runner script to generate test results. | 9 // These markers are read by the test runner script to generate test results. |
| 10 // It installs signal handlers to detect crashes. | 10 // It installs signal handlers to detect crashes. |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 jobject app_context) { | 121 jobject app_context) { |
| 122 base::AtExitManager exit_manager; | 122 base::AtExitManager exit_manager; |
| 123 | 123 |
| 124 // Command line initialized basically, will be fully initialized later. | 124 // Command line initialized basically, will be fully initialized later. |
| 125 static const char* const kInitialArgv[] = { "ChromeTestActivity" }; | 125 static const char* const kInitialArgv[] = { "ChromeTestActivity" }; |
| 126 CommandLine::Init(arraysize(kInitialArgv), kInitialArgv); | 126 CommandLine::Init(arraysize(kInitialArgv), kInitialArgv); |
| 127 | 127 |
| 128 // Set the application context in base. | 128 // Set the application context in base. |
| 129 base::android::ScopedJavaLocalRef<jobject> scoped_context( | 129 base::android::ScopedJavaLocalRef<jobject> scoped_context( |
| 130 env, env->NewLocalRef(app_context)); | 130 env, env->NewLocalRef(app_context)); |
| 131 base::android::InitApplicationContext(scoped_context); | 131 base::android::InitApplicationContext(env, scoped_context); |
| 132 base::android::RegisterJni(env); | 132 base::android::RegisterJni(env); |
| 133 | 133 |
| 134 std::vector<std::string> args; | 134 std::vector<std::string> args; |
| 135 ParseArgsFromCommandLineFile(kCommandLineFilePath, &args); | 135 ParseArgsFromCommandLineFile(kCommandLineFilePath, &args); |
| 136 | 136 |
| 137 std::vector<char*> argv; | 137 std::vector<char*> argv; |
| 138 int argc = ArgsToArgv(args, &argv); | 138 int argc = ArgsToArgv(args, &argv); |
| 139 | 139 |
| 140 // Fully initialize command line with arguments. | 140 // Fully initialize command line with arguments. |
| 141 CommandLine::ForCurrentProcess()->AppendArguments( | 141 CommandLine::ForCurrentProcess()->AppendArguments( |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 InstallHandlers(); | 191 InstallHandlers(); |
| 192 | 192 |
| 193 base::android::InitVM(vm); | 193 base::android::InitVM(vm); |
| 194 JNIEnv* env = base::android::AttachCurrentThread(); | 194 JNIEnv* env = base::android::AttachCurrentThread(); |
| 195 if (!RegisterNativesImpl(env)) { | 195 if (!RegisterNativesImpl(env)) { |
| 196 return -1; | 196 return -1; |
| 197 } | 197 } |
| 198 | 198 |
| 199 return JNI_VERSION_1_4; | 199 return JNI_VERSION_1_4; |
| 200 } | 200 } |
| OLD | NEW |