This source file includes following definitions.
- runOnMainSyncAndGetResult
package org.chromium.base.test.util;
import android.app.Instrumentation;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;
public final class InstrumentationUtils {
private InstrumentationUtils() {
}
public static <R> R runOnMainSyncAndGetResult(Instrumentation instrumentation,
Callable<R> callable) throws Throwable {
FutureTask<R> task = new FutureTask<R>(callable);
instrumentation.runOnMainSync(task);
try {
return task.get();
} catch (ExecutionException e) {
throw e.getCause();
}
}
}