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 #include <stdio.h> | 5 #include <stdio.h> |
6 | 6 |
7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
8 #include "base/android/jni_string.h" | 8 #include "base/android/jni_string.h" |
| 9 #include "base/android/locale_utils.h" |
9 #include "base/android/path_utils.h" | 10 #include "base/android/path_utils.h" |
10 #include "base/at_exit.h" | 11 #include "base/at_exit.h" |
11 #include "base/command_line.h" | 12 #include "base/command_line.h" |
12 #include "base/file_path.h" | 13 #include "base/file_path.h" |
13 #include "base/file_util.h" | 14 #include "base/file_util.h" |
14 #include "base/logging.h" | 15 #include "base/logging.h" |
15 #include "base/stringprintf.h" | 16 #include "base/stringprintf.h" |
16 #include "base/string_tokenizer.h" | 17 #include "base/string_tokenizer.h" |
17 #include "base/string_util.h" | 18 #include "base/string_util.h" |
18 #include "base/test/test_suite.h" | 19 #include "base/test/test_suite.h" |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 logging::DONT_LOCK_LOG_FILE, | 143 logging::DONT_LOCK_LOG_FILE, |
143 logging::DELETE_OLD_LOG_FILE, | 144 logging::DELETE_OLD_LOG_FILE, |
144 logging::ENABLE_DCHECK_FOR_NON_OFFICIAL_RELEASE_BUILDS); | 145 logging::ENABLE_DCHECK_FOR_NON_OFFICIAL_RELEASE_BUILDS); |
145 // To view log output with IDs and timestamps use "adb logcat -v threadtime". | 146 // To view log output with IDs and timestamps use "adb logcat -v threadtime". |
146 logging::SetLogItems(false, // Process ID | 147 logging::SetLogItems(false, // Process ID |
147 false, // Thread ID | 148 false, // Thread ID |
148 false, // Timestamp | 149 false, // Timestamp |
149 false); // Tick count | 150 false); // Tick count |
150 VLOG(0) << "Chromium logging enabled: level = " << logging::GetMinLogLevel() | 151 VLOG(0) << "Chromium logging enabled: level = " << logging::GetMinLogLevel() |
151 << ", default verbosity = " << logging::GetVlogVerbosity(); | 152 << ", default verbosity = " << logging::GetVlogVerbosity(); |
| 153 base::android::RegisterLocaleUtils(env); |
152 base::android::RegisterPathUtils(env); | 154 base::android::RegisterPathUtils(env); |
153 } | 155 } |
154 | 156 |
155 } // namespace | 157 } // namespace |
156 | 158 |
157 // This method is called on a separate java thread so that we won't trigger | 159 // This method is called on a separate java thread so that we won't trigger |
158 // an ANR. | 160 // an ANR. |
159 static void RunTests(JNIEnv* env, jobject obj, jstring jfiles_dir) { | 161 static void RunTests(JNIEnv* env, jobject obj, jstring jfiles_dir) { |
160 FilePath files_dir(base::android::ConvertJavaStringToUTF8(env, jfiles_dir)); | 162 FilePath files_dir(base::android::ConvertJavaStringToUTF8(env, jfiles_dir)); |
161 // A few options, such "--gtest_list_tests", will just use printf directly | 163 // A few options, such "--gtest_list_tests", will just use printf directly |
(...skipping 19 matching lines...) Expand all Loading... |
181 // This is called by the VM when the shared library is first loaded. | 183 // This is called by the VM when the shared library is first loaded. |
182 JNI_EXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) { | 184 JNI_EXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) { |
183 base::android::InitVM(vm); | 185 base::android::InitVM(vm); |
184 JNIEnv* env = base::android::AttachCurrentThread(); | 186 JNIEnv* env = base::android::AttachCurrentThread(); |
185 if (!RegisterNativesImpl(env)) { | 187 if (!RegisterNativesImpl(env)) { |
186 return -1; | 188 return -1; |
187 } | 189 } |
188 LibraryLoadedOnMainThread(env); | 190 LibraryLoadedOnMainThread(env); |
189 return JNI_VERSION_1_4; | 191 return JNI_VERSION_1_4; |
190 } | 192 } |
OLD | NEW |