Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(892)

Unified Diff: testing/android/reporter/java/src/org/chromium/test/reporter/TestStatusReceiver.java

Issue 1982493002: [Android] Log uncaught Java exceptions when running native tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix findbugs warning Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: testing/android/reporter/java/src/org/chromium/test/reporter/TestStatusReceiver.java
diff --git a/testing/android/reporter/java/src/org/chromium/test/reporter/TestStatusReceiver.java b/testing/android/reporter/java/src/org/chromium/test/reporter/TestStatusReceiver.java
index f0a0d7e4a86a17090854e7943e81a847cb1e63bb..e18efa8afc04815c917ae010a9290569424d6e1e 100644
--- a/testing/android/reporter/java/src/org/chromium/test/reporter/TestStatusReceiver.java
+++ b/testing/android/reporter/java/src/org/chromium/test/reporter/TestStatusReceiver.java
@@ -37,6 +37,7 @@ public class TestStatusReceiver extends BroadcastReceiver {
filter.addAction(TestStatusReporter.ACTION_TEST_STARTED);
filter.addAction(TestStatusReporter.ACTION_TEST_RUN_STARTED);
filter.addAction(TestStatusReporter.ACTION_TEST_RUN_FINISHED);
+ filter.addAction(TestStatusReporter.ACTION_UNCAUGHT_EXCEPTION);
try {
filter.addDataType(TestStatusReporter.DATA_TYPE_HEARTBEAT);
filter.addDataType(TestStatusReporter.DATA_TYPE_RESULT);
@@ -70,6 +71,7 @@ public class TestStatusReceiver extends BroadcastReceiver {
public interface TestRunCallback {
void testRunStarted(int pid);
void testRunFinished(int pid);
+ void uncaughtException(int pid, String stackTrace);
}
/** Register a callback for when a test has failed. */
@@ -145,6 +147,11 @@ public class TestStatusReceiver extends BroadcastReceiver {
c.testRunFinished(pid);
}
break;
+ case TestStatusReporter.ACTION_UNCAUGHT_EXCEPTION:
+ for (TestRunCallback c: mTestRunCallbacks) {
+ c.uncaughtException(pid, stackTrace);
+ }
+ break;
default:
Log.e(TAG, "Unrecognized intent received: %s", intent.toString());
break;

Powered by Google App Engine
This is Rietveld 408576698