Commit b385d080 authored by ppi@chromium.org's avatar ppi@chromium.org

Android: allow to kill a child process in instrumentation testing.

This patch exposes a method to kill a child process service of a given
pid, allowing regression integration test for http://crbug.com/399521 on
the embedder side.

BUG=399521

Review URL: https://codereview.chromium.org/441363003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@288071 0039d316-1c4b-4281-b951-d872f2087c98
parent fd76f06d
......@@ -6,6 +6,7 @@ package org.chromium.content.browser;
import android.content.Context;
import android.graphics.SurfaceTexture;
import android.os.RemoteException;
import android.util.Log;
import android.util.Pair;
import android.view.Surface;
......@@ -531,6 +532,23 @@ public class ChildProcessLauncher {
return sServiceMap.size();
}
/**
* Kills the child process for testing.
* @return true iff the process was killed as expected
*/
@VisibleForTesting
public static boolean crashProcessForTesting(int pid) {
if (sServiceMap.get(pid) == null) return false;
try {
((ChildProcessConnectionImpl) sServiceMap.get(pid)).crashServiceForTesting();
} catch (RemoteException ex) {
return false;
}
return true;
}
private static native void nativeOnChildProcessStarted(long clientContext, int pid);
private static native void nativeEstablishSurfacePeer(
int pid, Surface surface, int primaryID, int secondaryID);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment