Bug 1467916 - Make TestRunnerActivity exit if there is a content crash r=jchen
...and MOZ_CRASHREPORTER_SHUTDOWN is set.
MozReview-Commit-ID: FveSjoBYfJv
--- a/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/TestRunnerActivity.java
+++ b/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/TestRunnerActivity.java
@@ -13,16 +13,19 @@ import org.mozilla.geckoview.GeckoView;
import org.mozilla.geckoview.GeckoRuntime;
import org.mozilla.geckoview.GeckoRuntimeSettings;
import android.app.Activity;
import android.content.Intent;
import android.graphics.SurfaceTexture;
import android.net.Uri;
import android.os.Bundle;
+import android.os.Handler;
+import android.os.Looper;
+import android.util.Log;
import android.view.Surface;
public class TestRunnerActivity extends Activity {
private static final String LOGTAG = "TestRunnerActivity";
static GeckoRuntime sRuntime;
private GeckoSession mSession;
@@ -86,30 +89,34 @@ public class TestRunnerActivity extends
}
@Override
public void onExternalResponse(GeckoSession session, GeckoSession.WebResponseInfo request) {
}
@Override
public void onCrash(GeckoSession session) {
+ if (System.getenv("MOZ_CRASHREPORTER_SHUTDOWN") != null) {
+ sRuntime.shutdown();
+ }
}
};
private GeckoSession createSession() {
return createSession(null);
}
private GeckoSession createSession(GeckoSessionSettings settings) {
if (settings == null) {
settings = new GeckoSessionSettings();
}
final GeckoSession session = new GeckoSession(settings);
session.setNavigationDelegate(mNavigationDelegate);
+ session.setContentDelegate(mContentDelegate);
return session;
}
private GeckoSession createBackgroundSession(GeckoSessionSettings settings) {
final GeckoSession session = createSession(settings);
final SurfaceTexture texture = new SurfaceTexture(0);
final Surface surface = new Surface(texture);