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 11 matching lines...) Expand all Loading... |
22 #include "base/command_line.h" | 22 #include "base/command_line.h" |
23 #include "base/files/file_path.h" | 23 #include "base/files/file_path.h" |
24 #include "base/files/file_util.h" | 24 #include "base/files/file_util.h" |
25 #include "base/logging.h" | 25 #include "base/logging.h" |
26 #include "base/strings/stringprintf.h" | 26 #include "base/strings/stringprintf.h" |
27 #include "base/test/test_support_android.h" | 27 #include "base/test/test_support_android.h" |
28 #include "gtest/gtest.h" | 28 #include "gtest/gtest.h" |
29 #include "jni/NativeTest_jni.h" | 29 #include "jni/NativeTest_jni.h" |
30 #include "testing/android/native_test/native_test_util.h" | 30 #include "testing/android/native_test/native_test_util.h" |
31 | 31 |
| 32 using base::android::JavaParamRef; |
| 33 |
32 // The main function of the program to be wrapped as a test apk. | 34 // The main function of the program to be wrapped as a test apk. |
33 extern int main(int argc, char** argv); | 35 extern int main(int argc, char** argv); |
34 | 36 |
35 namespace testing { | 37 namespace testing { |
36 namespace android { | 38 namespace android { |
37 | 39 |
38 namespace { | 40 namespace { |
39 | 41 |
40 const char kLogTag[] = "chromium"; | 42 const char kLogTag[] = "chromium"; |
41 const char kCrashedMarker[] = "[ CRASHED ]\n"; | 43 const char kCrashedMarker[] = "[ CRASHED ]\n"; |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 sa.sa_sigaction = SignalHandler; | 152 sa.sa_sigaction = SignalHandler; |
151 sa.sa_flags = SA_SIGINFO; | 153 sa.sa_flags = SA_SIGINFO; |
152 | 154 |
153 for (unsigned int i = 0; kExceptionSignals[i] != -1; ++i) { | 155 for (unsigned int i = 0; kExceptionSignals[i] != -1; ++i) { |
154 sigaction(kExceptionSignals[i], &sa, &g_old_sa[kExceptionSignals[i]]); | 156 sigaction(kExceptionSignals[i], &sa, &g_old_sa[kExceptionSignals[i]]); |
155 } | 157 } |
156 } | 158 } |
157 | 159 |
158 } // namespace android | 160 } // namespace android |
159 } // namespace testing | 161 } // namespace testing |
OLD | NEW |