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

Unified Diff: testing/android/reporter/java/src/org/chromium/test/reporter/TestStatusReporter.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
« no previous file with comments | « testing/android/reporter/java/src/org/chromium/test/reporter/TestStatusReceiver.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: testing/android/reporter/java/src/org/chromium/test/reporter/TestStatusReporter.java
diff --git a/testing/android/reporter/java/src/org/chromium/test/reporter/TestStatusReporter.java b/testing/android/reporter/java/src/org/chromium/test/reporter/TestStatusReporter.java
index 1d887008bff9303f276550662d498db13b44e7a8..31da20e9442432635a73a8120ba037ff24a28a5a 100644
--- a/testing/android/reporter/java/src/org/chromium/test/reporter/TestStatusReporter.java
+++ b/testing/android/reporter/java/src/org/chromium/test/reporter/TestStatusReporter.java
@@ -6,6 +6,7 @@ package org.chromium.test.reporter;
import android.content.Context;
import android.content.Intent;
+import android.util.Log;
import org.chromium.base.ThreadUtils;
@@ -28,6 +29,8 @@ public class TestStatusReporter {
"org.chromium.test.reporter.TestStatusReporter.TEST_RUN_STARTED";
public static final String ACTION_TEST_RUN_FINISHED =
"org.chromium.test.reporter.TestStatusReporter.TEST_RUN_FINISHED";
+ public static final String ACTION_UNCAUGHT_EXCEPTION =
+ "org.chromium.test.reporter.TestStatusReporter.UNCAUGHT_EXCEPTION";
public static final String DATA_TYPE_HEARTBEAT = "org.chromium.test.reporter/heartbeat";
public static final String DATA_TYPE_RESULT = "org.chromium.test.reporter/result";
public static final String EXTRA_PID =
@@ -107,6 +110,14 @@ public class TestStatusReporter {
mContext.sendBroadcast(i);
}
+ public void uncaughtException(int pid, Throwable ex) {
+ Intent i = new Intent(ACTION_UNCAUGHT_EXCEPTION);
+ i.setType(DATA_TYPE_RESULT);
+ i.putExtra(EXTRA_PID, pid);
+ i.putExtra(EXTRA_STACK_TRACE, Log.getStackTraceString(ex));
+ mContext.sendBroadcast(i);
+ }
+
public void stopHeartbeat() {
mKeepBeating.set(false);
}
« no previous file with comments | « testing/android/reporter/java/src/org/chromium/test/reporter/TestStatusReceiver.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698